20 Time Intelligence DAX measures in Power BI with examples:
Year-to-Date Sales:
cssYTD Sales = TOTALYTD([Total Sales], Calendar[Date])
Month-to-Date Sales:
cssMTD Sales = TOTALMTD([Total Sales], Calendar[Date])
Quarter-to-Date Sales:
cssQTD Sales = TOTALQTD([Total Sales], Calendar[Date])
Previous Year Sales:
mathematicaPrevious Year Sales = CALCULATE([Total Sales], SAMEPERIODLASTYEAR(Calendar[Date]))
Year-over-Year Growth:
cssYoY Growth = DIVIDE([Total Sales] - [Previous Year Sales], [Previous Year Sales])
Rolling 3-Month Average Sales:
sql3M Rolling Avg Sales = AVERAGEX(DATESINPERIOD(Calendar[Date], MAX(Calendar[Date]), -3, MONTH), [Total Sales])
Cumulative Sales:
scssCumulative Sales = SUMX(FILTER(ALL(Calendar), Calendar[Date] <= MAX(Calendar[Date])), [Total Sales])
Running Total Sales:
scssRunning Total Sales = SUMX(FILTER(ALL(Calendar), Calendar[Date] <= MAX(Calendar[Date])), [Total Sales])
Year-to-Date Profit:
cssYTD Profit = TOTALYTD([Total Profit], Calendar[Date])
Month-to-Date Profit:
cssMTD Profit = TOTALMTD([Total Profit], Calendar[Date])
Quarter-to-Date Profit:
cssQTD Profit = TOTALQTD([Total Profit], Calendar[Date])
Rolling 12-Month Total Sales:
scss12M Rolling Sales = SUMX(DATESYTD(Calendar[Date]), [Total Sales])
Average Sales per Day:
sqlAvg Sales per Day = DIVIDE([Total Sales], COUNTROWS(DATESYTD(Calendar[Date])))
First Date of Sales:
mathematicaFirst Sales Date = MINX(FILTER(Calendar, [Total Sales] > 0), Calendar[Date])
Last Date of Sales:
mathematicaLast Sales Date = MAXX(FILTER(Calendar, [Total Sales] > 0), Calendar[Date])
Number of Days with Sales:
cssDays with Sales = COUNTROWS(FILTER(Calendar, [Total Sales] > 0))
Average Sales Growth Rate:
scssAvg Sales Growth Rate = AVERAGEX(VALUES(Calendar[Year]), [YoY Growth])
Total Sales for Selected Period:
sqlSales for Selected Period = CALCULATE([Total Sales], DATESBETWEEN(Calendar[Date], [Start Date], [End Date]))
Max Sales Date:
scssMax Sales Date = CALCULATE(MAX(Calendar[Date]), FILTER(ALL(Calendar), [Total Sales] = [Max Sales]))
Min Sales Date:
scssMin Sales Date = CALCULATE(MIN(Calendar[Date]), FILTER(ALL(Calendar), [Total Sales] = [Min Sales]))
These time intelligence measures help you analyze data over different time periods, calculate growth rates, and track trends within your Power BI reports. Remember to adjust them based on your specific date and data structure.
- Get link
- X
- Other Apps
Labels
Power BI
Labels:
Power BI
- Get link
- X
- Other Apps
Comments
Post a Comment