Forum Discussion
mbudiman
Helper III
11 months agoCalculate difference between versions of Forecast data
Hello, I need help for a DAX measure to calculate Forecast Qty difference between versions for each Fiscal Qtr. A Fiscal Qtr may have multiple versions of Forecast. See example data below. ...
- 11 months ago
and try this
Measure = VAR NumQuarter = SELECTEDVALUE('Sales Forecast'[NumQuarter])-1 VAR PQTY = CALCULATE([FCST_QTY], 'Sales Forecast'[NumQuarter]= NumQuarter , REMOVEFILTERS('DimVersionNo'),REMOVEFILTERS(DimFYFISCAL)) RETURN [FCST_QTY] - PQTY
Ahmedx
Super User
11 months agoand try this
Measure =
VAR NumQuarter = SELECTEDVALUE('Sales Forecast'[NumQuarter])-1
VAR PQTY =
CALCULATE([FCST_QTY], 'Sales Forecast'[NumQuarter]= NumQuarter , REMOVEFILTERS('DimVersionNo'),REMOVEFILTERS(DimFYFISCAL))
RETURN
[FCST_QTY] - PQTY
- mbudiman10 months ago
Helper III
hi Ahmedx ,
Could you help me again. When I apply your solution, I dont get the same value of NumQuarter. I cant figure out why. Appreciate if you could advise if I miss something. Thank you.
What I did was create new Column for "NumQuarter" with the same formula as your pbix, but result is different. See below.
- Ahmedx10 months ago
Super User
It seems you just need to change the format
- mbudiman10 months ago
Helper III
hi Ahmedx ,
Thats not what I meant. The value of NumQuarter for Fiscal Qtr "FY26Q1" and Version_No "1" should always be 20,260,101, but my pbix sum up all the rows of FY26Q1 and Version_No=1 to 78,244,510,062. Because of this, I dont get correct Forecast Qty difference.