In Power Bi
In Power Bi
IN POWER BI
DAX (DATA ANALYSIS EXPRESSIONS)
It is a formula language and a collection of functions used
to create custom calculations. It helps us create new
information from data already in our model.
Table which I have used to explain DAX functions:
Customer Table
Sales Table
Product Table
Data Model:
Here are some of the important functions:
COUNT(): Counts the number of rows in the specified column that contain
non-blank values.
Syntax: COUNT([<table>])
COUNTX(): This function is used to count the number of rows in a table that
meet specified conditions.
Syntax: COUNTX([<table>])
SUMMARIZE: This function is used to create a summary table that aggregates data
based on specified groupings or criteria. It's similar to SQL's GROUP BY
clause.
Syntax:
SUMMARIZE (<table>, <groupBy_columnName>
[, <groupBy_columnName>]…[, <name>, <expression>]…)
SELECTEDVALUE(): Returns the value when the context for columnName has been
filtered down to one distinct value only. Otherwise returns
alternateResult.
Syntax:
SELECTEDVALUE(<columnName>[, <alternateResult>])