Power BI - most used DAX Queries p1

DAX (Data Analysis Expressions)

CALCULATE

Syntax:

CALCULATE( Aggregate Function, Filters)
Example
CALCULATE(SUM(SALES[AMOUNT]), SALES[REGION]='NORTH')
This DAX query calculates the SUM of Amount from Sales table for NORTH region
FILTER

Syntax:

FILTER(Table, Filter)
Example
FILTER(SALES, SALES[AMOUNT] > 1000)
This DAX query filters the rows from Sales tables based on condition SALES[AMOUNT] > 1000
SUM

Syntax:

SUM(Table[field])
Example
SUM(Sales[Amount])
This DAX query returns the sum of Amount column in the Sales table
AVERAGE

Syntax:

AVERAGE(Table[column])
Example
AVERAGE(SALES[AMOUNT])
Returns the average of Amount column from the Sales table
COUNT

Syntax:

COUNT(Table[column])
Example
COUNT(SALES[AMOUNT])
Returns the count of non-blank rows in the Amount column of Sales table
DISTINCTCOUNT

Syntax:

DISTINCTCOUNT(Table[column])
Example
DISTINCTCOUNT(SALES[PRODUCT])
Returns the count of unique product from sales table

Comments

Popular Posts