0% found this document useful (0 votes)
19 views

PowerBI Daxi

Uploaded by

ponsee9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

PowerBI Daxi

Uploaded by

ponsee9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Power BI for Business Intelligence

DAX
Cheat Sheet

Math & statistical functions

Mayur Dhepekar
Power BI for Business Intelligence

SUM(<column>) - Adds all the numbers in a column.

Example: SUM(Sales[Amount])

Adds up all values in the "Amount" column of the "Sales" table.

SUMX(<table>, <expression>) - Adds up the results of an expression for each row in a table.

Example: SUMX(Sales, Sales[Quantity] * Sales[Price])

Multiplies "Quantity" by "Price" for each row and then sums the results.

AVERAGE(<column>) - Calculates the average (mean) of all the numbers in a column.

Example: AVERAGE(Sales[Amount])

Calculates the average value in the "Amount" column of the "Sales" table.

AVERAGEX(<table>, <expression>) - Calculates the average of a set of expressions evaluated for each row in

a table.

Example: AVERAGEX(Sales, Sales[Quantity] * Sales[Price])

Calculates the average of the total sales value (Quantity * Price) for each row in the "Sales" table.

MEDIAN(<column>) - Returns the middle value (median) of a column.-

Example: MEDIAN(Sales[Amount])

Finds the median value of the "Amount" column in the "Sales" table.

MEDIANX(<table>, <expression>) - Calculates the median of expressions evaluated for each row in a table.

Example: MEDIANX(Sales, Sales[Quantity] * Sales[Price])

Calculates the median of the total sales value (Quantity * Price) for each row in the "Sales" table.

GEOMEAN(<column>) - Computes the geometric mean of a column.

Example: GEOMEAN(Sales[Amount])

Calculates the geometric mean of the "Amount" column in the "Sales" table.])

Calculates the geometric mean of the total sales value (Quantity * Price) for each row in the "Sales" table.

COUNT(<column>) - Counts the number of non-blank values in a column.

Example: COUNT(Sales[Amount])

Counts the number of non-blank values in the "Amount" column in the "Sales" table.

Mayur Dhepekar
Power BI for Business Intelligence

COUNTX(<table>, <expression>) - Counts the number of rows where an expression evaluates to a non-blank

value.

Example: COUNTX(Sales, Sales[Quantity] * Sales[Price])

Counts the number of rows where the result of "Quantity * Price" is not blank.

DIVIDE(<numerator>, <denominator>, [<alternateresult>]) - Divides two numbers and returns an alternate

result or BLANK() if the denominator is zero.

Example: DIVIDE(Sales[TotalAmount], Sales[Quantity], 0)

Divides "TotalAmount" by "Quantity" and returns 0 if the denominator is zero.

MIN(<column>) - Returns the smallest number in a column.

Example: MIN(Sales[Amount])

Finds the smallest value in the "Amount" column in the "Sales" table.

MAX(<column>) - Returns the largest number in a column.

Example: MAX(Sales[Amount])

Finds the largest value in the "Amount" column in the "Sales" table.

COUNTROWS(<table>) - Counts the number of rows in a table.

Example: COUNTROWS(Sales)

Counts the total number of rows in the "Sales" table.

DISTINCTCOUNT(<column>) - Counts the number of unique (distinct) values in a column.

Example: DISTINCTCOUNT(Sales[ProductID])

Counts the number of unique products in the "ProductID" column of the "Sales" table.

RANKX(<table>, <expression>, [, <value>, [, <order>, [, <ties>]]]) - Ranks a value within a list of numbers for

each row in a table.

Example: RANKX(Sales, Sales[Amount])

Ranks the "Amount" values in the "Sales" table from highest to lowest.

Mayur Dhepekar

You might also like