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

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

Reply
Anonymous
Not applicable

Calculating Difference in percentage between the values of two Measures

I have been struggling to generate the accurate differences in percentage between MTD Sales and Sales Forecast for each country. I tried using a simple Divide function and it is yielding inaccurate results. For Denmark for instance, the value that should be shown is  -22.58% but instead it is showing 77%. Any help would be appreciated, please see photo and DAX below. 

 

The Measure MTD Sales is self explanatory and shows the Sales to date in the selected month. 

 

Dax:

 

MTD Sales = TOTALMTD(SUM('Fact'[amount]),'Calendar'[date])
 
The Sales Forecast shows the forecasted sales based on the average MTD sales. 
 
Dax: 

Sales Forecast =
Var _avg = CALCULATE(AVERAGEX(VALUES('Calendar'[date]),CALCULATE(SUM('Fact'[amount]))),DATESMTD('Calendar'[date]))
return
_avg*DAY(EOMONTH(MAX('Calendar'[date]),0))
 
 
Capture.PNG
 
 
9 REPLIES 9
tamerj1
Super User
Super User

Hi @Anonymous 

it is showing the grand total percentage everywhere. It lloks like the filter is lost somehow in the measure. Can you please share the code for the difference measure?

Anonymous
Not applicable

Diff=DIVIDE (MTD SALES, SALES FORECAST, BLANK ())

Thanks for your comment @tamerj1 

@Anonymous 

Just noticesmd that they have all the same percentage 

please use

Diff =
DIVIDE ( [MTD SALES] - [SALES FORECAST], [SALES FORECAST], BLANK () )

Anonymous
Not applicable

Have tried your solution and it is showing the accurate difference for the total MTD SALES with the Sales Forecast but it is not showing in the individual rows. For example, it is not showing whats the difference between the MTD SALES AND Sales forecast for Sweden. Please see image. All values are 22.58% @tamerj1 

 

Capture.PNG

@Anonymous 

Yes but these are the coorect results as per the existing numbers. I did the calculations manually and indeed they are all the same. 
this is becuase the forcast is calculated based on the measure multiplied by a fixed percentage which you are now trying to calculate!

Anonymous
Not applicable

Is there a way to get it to show on individual rows for each country? As for every row, it is just showing the total @tamerj1 ? 

Hi, @Anonymous 

 

What do you expect the output to look like? Is it possible to show it in a picture

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Anonymous 

Please read my last reply. I explained that this is how your numbers are. If you do the calculations manually you will get -22.58% in every single row. 

MTD SALES is a measure? What is the code?

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.