Quick DAX References
-
View The DAX Cheat Sheet
Basic formulas you can use to make changes to control properties, including format, position, simple calculations, and implementing conditional formatting.
-
Start Here: DAX Beginner Tutorial Video
The best interactive video to start when learning DAX. Learn the DAX fundamentals as well as topics like row context, the CALCULATE function and context transition.
-
Dashboard in a Day Free Recordings
Click Free Trial for a forever free Dashboard in a Day class amongst other courses.
-
Download Our Free DAX Guidebook
Get a breakdown of how you can use DAX to get the most out of your data.
-
Get Started With Power BI For Free
Create rich, interactive reports with visual analytics at your fingertips—for free. Once there, click Try Power BI For Free and use your credentials.
-
Power BI Licensing
See the present pricing for Power BI
DAX Cheat Sheet
Problem | Calculation Expression |
---|---|
Total Sales Calculation | Calculated measure using SUM to aggregate a column.
|
Total Cost Calculation | Calculated measure using SUM to aggregate a column.
|
Profit Calculation | Calculated measure using two previously created calculated measures to determine
profit.
|
Profit Margin | Calculated measure using two previously created calculated measures to determine
profit margin, the DIVIDE function is used to perform the division.
|
Transaction Count | Calculated measure that returns a count of all rows in a table, ultimately, many
times this simple calculation is used to return transaction counts.
|
Related Table Count | Returns the total rows in a related table. For example, total transactions by
Product.
|
Month to Date Sales
Problem | Calculation Expression |
---|---|
MTD Sales | Calculates Total Sales for all days in the current month up to the maximum day in
the selection.
|
MTD Sales (Direct Query) | Calculates Total Sales for all days in the current month up to the maximum day in
the selection.
|
Year to Date Sales
Problem | Calculation Expression |
---|---|
YTD Sales | Calculates Total Sales for all days in the year up to the maximum day in the
selection.
|
YTD Sales (Fiscal Calendar) | This calculation uses an optional third parameter specifying the fiscal year end
date.
|
YTD Sales (Direct Query) | Calculates Total Sales for all days in the year up to the maximum day in the
selection.
|
Prior Year Sales
Problem | Calculation Expression |
---|---|
Prior Year Profit |
|
Prior Year Profit (Direct Query) | Calculates Profit for all days in the Year prior to the last year in the selection.
Limited to the last day of the selection.
|
Year over Year Profit | Calculated measure using two previously created calculated measures to determine
YoY profit.
|
Last Year YTD Sales |
|
Total Sales for all Countries | This calculation uses calculate to return all countries in the calculation
regardless of the filter context.
|
Percent of Total Calculation | This calculation uses two measures previously created to create a percent of total
calculation.
|
Moving Totals
Problem | Calculation Expression |
---|---|
Rolling 12 Month Sales | Calculated measure that returns a rolling 12 months total for Profit.
|
7 Day Moving Average Profit | This calculation generates the daily moving average. The number of days can be
changed accordingly.
|
Country Rank | Calculated measure to rank a specific column in a table by a measure. In this
measure Country from the geography table is being ranked by the measure [Total
Sales].
|