DAX (Data Analysis Expressions) is the calculation language of Power BI. It is used to create calculations, KPIs, and business logic. This lesson assumes the student knows nothing about DAX.
A basic DAX measure follows a simple pattern:
// Generic DAX measure syntax
Measure Name = FUNCTION(Table[Column])
// Clean sales data
OrderID,Product,Quantity,Sales,Cost
1,Laptop,2,2000,1500
2,Mobile,1,1500,1100
3,Laptop,3,3000,2200
4,Keyboard,1,800,500
5,Mouse,2,600,300
6,Mobile,2,3000,2100
// Calculate total sales
Total Sales = SUM(Sales[Sales])
The Total Sales measure dynamically recalculates based on filters such as Product, Date, or Region applied in the report.
// Visual filter interaction example
User selects Product = Laptop
Power BI applies filter context
DAX recalculates measure
Visual updates automatically
Change the filter or function to see how the DAX formula and result change instantly.