Hi Guys
I'm sure you get this question a lot from newbies but, given my circumstances, how can I create a pivot table with Variance and Variance % columns?
I'd like a way to keep my column label (Actual, Forecast, Plan & Last Year) but I don't know how to write a measure which refers to each in order to calculate variances between them. One method I made involved manually creating all of my columns (which allows me to refer to them) using the measures below, but surely this isn't best practice?
I've only been using PowerPivot for a week so bear with me... If you require any more info, e.g. my table layout or a better explanation (I found it difficult to word this), please ask!
I'm sure you get this question a lot from newbies but, given my circumstances, how can I create a pivot table with Variance and Variance % columns?
I'd like a way to keep my column label (Actual, Forecast, Plan & Last Year) but I don't know how to write a measure which refers to each in order to calculate variances between them. One method I made involved manually creating all of my columns (which allows me to refer to them) using the measures below, but surely this isn't best practice?
Code:
ACTUALS:=CALCULATE(-SUM('COMBINED GL DATA'[CURRENT PERIOD]),'COMBINED GL DATA'[SOURCE]="CURRENT YEAR ACTUALS")
PLAN:=CALCULATE(-SUM('COMBINED GL DATA'[CURRENT PERIOD]),'COMBINED GL DATA'[SOURCE]="CURRENT YEAR PLAN")
FORECAST:=CALCULATE(-SUM('COMBINED GL DATA'[CURRENT PERIOD]),'COMBINED GL DATA'[SOURCE]="CURRENT YEAR FORECAST")
LAST YEAR:=CALCULATE(-SUM('COMBINED GL DATA'[CURRENT PERIOD]),'COMBINED GL DATA'[SOURCE]="LAST YEAR ACTUALS")
FORECAST VAR:=[ACTUALS]-[FORECAST]
PLAN VAR:=[ACTUALS]-[PLAN]
LY VAR:=[ACTUALS]-[LAST YEAR]
BLANK:=blank()
FC VAR %:=IFERROR([FORECAST VAR]/[ACTUALS],BLANK())
PLAN VAR (%):=IFERROR([PLAN VAR]/[ACTUALS],BLANK())
LY VAR (%):=IFERROR([LY VAR]/[ACTUALS],BLANK())
I've only been using PowerPivot for a week so bear with me... If you require any more info, e.g. my table layout or a better explanation (I found it difficult to word this), please ask!