Hi everyone - first time, long time…
I have created a measure to calculate the Absolute Variance at different aggregated levels of a hierarchy. This is working as expected and also works for YTD if multiple months are selected in a slicer.
Absolute Variance =
VAR RowAbs = AVERAGEX(VALUES(Codes[Category]),ABS([Actual vs Selected Version Var]))
VAR TotalAbs = SUMMARIZE(Expenses,Codes[Category],'Business Units'[BU Name],"Sum Category",[Actual vs Selected Version Var])
RETURN
IF( HASONEVALUE( Codes[Category] ) ,
RowAbs,
SUMX(TotalAbs,ABS([Sum Category])))
I am having trouble creating a measure to calculate the YTD results with only one month selected in a slicer. I (think I) understand what I need to do:
- Add a date column to the TotalAbs variable
- remove the date context from the TotalAbs variable
- filter to be <= the select month
I have attempted to use ALL and CALCULATETABLE without success.
Here is a file for reference Costs.pbix (153.7 KB)
Many thanks!
Jeremy