Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
mbudiman
Helper III
Helper III

Calculate 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.

 

Fiscal QtrVersionVersion No (descending)Remark

FY26Q1

Oct-251Forecast for FY26Q1 as of Oct-25
FY26Q1Sep-25

2

Forecast for FY26Q1 as of Sep-25
FY26Q1Aug-253Forecast for FY26Q1 as of Aug-25

 

Here is the link for sample pbix data. I want to show Forecast Qty difference between versions as below. Pls advise. Thank you in advance. Forecast Difference from Prev.pbix

image.jpg

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

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 

Screenshot_1.pngScreenshot_4.png

View solution in original post

30 REPLIES 30
Ahmedx
Super User
Super User

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 

Screenshot_1.pngScreenshot_4.png

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.

 

image.jpg

image2.jpg

It seems you just need to change the format
Screenshot_1.png

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.

Hi @mbudiman,

Have you had a chance to review the solution we shared by @Ahmedx  If the issue persists, feel free to reply so we can help further.

 

Thank you.

hi @v-saisrao-msft 

 

I still have problem, the solution does not work in pbix. I am trying to figure out why. Do you have other suggestion to derive calculation of difference of Forecast Qty from previous version ?

try creating another new column

Screenshot_3.pngScreenshot_4.png

Here is my actual pbix data structure with mockup data. When I apply solution suggested by you, it does not work. SalesForecast sample.pbix

pls try

 

does not work, QTY Diff does not show calculate correctly. image.jpg

 

try

 

hi @Ahmedx ,

 

It seems like you are calculating Qty difference between Fiscal Qtr instead of between 'Version No' of the same Fiscal Qtr. The solution does not work.

try changing 1 to 0
Screenshot_1.pngScreenshot_2.png

hi @Ahmedx , 

It works partially for Version_No = 2 and Version_No =1, but not for Version_No = 0 (Preview).image.jpg

will everything be at zero there?
Screenshot_1.png

QTY DIFF should be compare for versions within the same Fiscal Qtr. When reach max Version (based on Version No) of the same Fiscal Qtr, there is no more version to compare, thus QTY DIFF should be blank. If there is only 1 version for that Fiscal Qtr, then there is no data to compare, thus QTY DIFF should be blank (or zero).

 

See illustration below.image.jpg

This is what I got, I don't know if this solves your problem

hi @Ahmedx , it does not really solve the problem, but it gives me clue. I managed to achieve result I want. Thank you for your time and assisting with solution. Appreciate it.

How to fix it

You can tell Power BI not to summarize this column.

Steps:

  1. In the Fields pane, find your column NumQuarter.

  2. Right-click on it (or click the small arrow next to it).

  3. Select “Default summarization” → “Do not summarize”.

Screenshot_2.png

hi @Ahmedx ,

 

Thank you for the solution. It works 😀

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors