By: Aishwarya Mate
By: Aishwarya Mate
By : Aishwarya Mate
Purpose of DAX:
•Enables custom calculations and data analysis within Power
BI.
Key Features:
•Calculated Columns: Created based on DAX formulas and
stored in the data model.
•Measures: Dynamic calculations performed on the fly within
visuals and reports.
•Custom Tables: Generate new tables using DAX formulas.
MEASURES IN DAX
• Measure in DAX is a single value that we calculate from any
column.
• Measures often use aggregation functions like SUM, AVERAGE,
MIN, MAX, COUNT, DISTINCTCOUNT, etc., to summarize data.
• Measures are calculated for any column, i.e. Numerical, Text,
Date.
DAX
Iterator Functions
Iterator functions in DAX (Data Analysis Expressions) in Power
BI are functions that perform row-by-row operations over a
table and then aggregate the results. Unlike simple aggregation
functions that operate on entire columns, iterator functions can
work with complex expressions involving multiple columns and
calculations for each row.
SUMX
AVERAGEX
MINX
MAXX
COUNTX
Total Revenue: TotalRevenue = SUMX(Sales, Sales[Quantity] * Sales[Price])
Average Revenue: Average Revenue = AVERAGEX(Sales, Sales[Quantity] * Sales[Price])
RANKX
For 2 conditions:
tablename = FILTER(Tablename, OR(Table[Column] = ‘Value’ ,Table[Column] = ‘Value’))
Syntax :
Tablename = CALCULATETABLE(Table, Filter1, Filter2)