Dashboard Mode - Why DAX powers calculations in Power BI
Business Question
How can we use DAX formulas in Power BI to calculate total sales, average sales, and sales growth to better understand our business performance?
How can we use DAX formulas in Power BI to calculate total sales, average sales, and sales growth to better understand our business performance?
| Month | Sales | Cost |
|---|---|---|
| 1 | 100 | 60 |
| 2 | 150 | 90 |
| 3 | 200 | 120 |
| 4 | 180 | 110 |
| 5 | 220 | 130 |
Total Sales = SUM(SalesData[Sales])Average Sales = AVERAGE(SalesData[Sales])Total Cost = SUM(SalesData[Cost])Sales Growth =
VAR CurrentMonth = MAX(SalesData[Month])
VAR CurrentSales = CALCULATE(SUM(SalesData[Sales]), SalesData[Month] = CurrentMonth)
VAR PrevMonth = CALCULATE(MAX(SalesData[Month]), FILTER(SalesData, SalesData[Month] < CurrentMonth))
VAR PrevSales = CALCULATE(SUM(SalesData[Sales]), SalesData[Month] = PrevMonth)
RETURN
IF(NOT(ISBLANK(PrevSales)), (CurrentSales - PrevSales) / PrevSales, BLANK())+----------------------+----------------------+----------------------+ | Total Sales (KPI) | Average Sales (KPI) | Total Cost (KPI) | +----------------------+----------------------+----------------------+ | | Line Chart: Sales Over Months | +------------------------------------------------------+ | Sales Growth (Table or Card) +------------------------------------------------------+
A slicer for Month allows filtering the data shown in all components. Selecting a specific month updates the KPIs and the sales growth measure to reflect that month's data. The line chart updates to show sales only up to the selected month. This helps users focus on specific time periods.
If you add a filter to show only months from 3 to 5, which components update and how?