The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi
I have a measure for year to date cost variance:
YTD Variance = CALCULATE ( [Variance], ALL(PERIODS[MonthName]), All(PERIODS[PD_PERIOD]), PERIODS[PD_PERIOD]<= MAX(PERIODS[PD_PERIOD]))
This works fine with a matrix where I have period in the columns, period being the finanical month number starting at 1 for April in UK.
I have a calculated column for month name in the same table which is just calculated from the period number:
MonthName = FORMAT(DATE(1, IF([PD_PERIOD]<9,PERIODS[PD_PERIOD]+3,PERIODS[PD_PERIOD]-9), 1), "MMM")
and as soon as I switch from period to month name in the matrix columns it stops giving a rolling total and gives an in month figure despite me adding in the "All(PERIODS[MonthName])" to the calculate filter?
Any ideas?
Your data model needs a proper calendar table, marked as such. If your fact table doesn't have dates you need to add a fake date column (for example first day of the month). Don't try to do time intelligence without a calendar table.
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
9 | |
7 |