Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
Every week I get sales forecasts for which I have to compare the values. Sample model here:
I am looking for a way to show the changes between individual forecasts in quantitative and percentage terms, like in this Excel:
Thank you in advance for any tips.
Marcin
Solved! Go to Solution.
Hi @maart666 ,
Modify your measure as below:
Difference =
VAR thisforecastnum =
MIN ( Arkusz1[Forecast no] )
VAR thisforecast =
SUM ( Arkusz1[Qty] )
var lastforecastnum=CALCULATE(MAX('Arkusz1'[Forecast no]),FILTER(ALLSELECTED(Arkusz1),'Arkusz1'[Forecast no]<MAX('Arkusz1'[Forecast no])))
VAR lastforecast =
CALCULATE (
SUM ( Arkusz1[Qty] ),
Arkusz1[Forecast no] = lastforecastnum
)
RETURN
IF (
ISBLANK ( lastforecast ),
BLANK (),
thisforecast - lastforecast
)
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Thank you Kelly,
works perfect!
I salut you!
Marcin
Hi Kelly,
it looks great accept one case, when in lastforecast there was no value (filed was empty), and in thisforecast is value, mesure do not count that diefference... Is it a way to clear that issue?
Thank you.
Marcin
Thank you Pat!
It works perfectly when I compare data from subsequent forecasts. But if the forecasts are not consecutive e.g. 1 and 3 (I know I should mentioned this) the values are incorrect:
Could you help solve this problem?
Thank you.
Marcin
Hi @maart666 ,
Modify your measure as below:
Difference =
VAR thisforecastnum =
MIN ( Arkusz1[Forecast no] )
VAR thisforecast =
SUM ( Arkusz1[Qty] )
var lastforecastnum=CALCULATE(MAX('Arkusz1'[Forecast no]),FILTER(ALLSELECTED(Arkusz1),'Arkusz1'[Forecast no]<MAX('Arkusz1'[Forecast no])))
VAR lastforecast =
CALCULATE (
SUM ( Arkusz1[Qty] ),
Arkusz1[Forecast no] = lastforecastnum
)
RETURN
IF (
ISBLANK ( lastforecast ),
BLANK (),
thisforecast - lastforecast
)
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
This measure expression will give you the difference from the current forecast to the previous one.
Difference =
VAR thisforecastnum =
MIN ( Arkusz1[Forecast no] )
VAR thisforecast =
SUM ( Arkusz1[Qty] )
VAR lastforecast =
CALCULATE (
SUM ( Arkusz1[Qty] ),
Arkusz1[Forecast no] = thisforecastnum - 1
)
RETURN
IF (
ISBLANK ( lastforecast ),
BLANK (),
thisforecast - lastforecast
)
To get your % difference, just change the Return part using the same variable (e.g., DIVIDE(thisforecast - lastforecast, lastforecast)
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
68 | |
53 | |
39 | |
33 |
User | Count |
---|---|
70 | |
63 | |
57 | |
49 | |
46 |