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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Power Bi not calculating percentage correctly

Hello,
I'm running into a strange result when attemting to calculate percentage difference between 2 numbers and would really appreciate any incite into the problem. 

Measure: 

% Change =
     VAR diff =
       CALCULATE(TableA[Measure_Total_Sum] - TableA[Measure_Total_Sum_Prior_Yr])
     RETURN
       DIVIDE(diff TableA[Measure_Total_Sum_Prior_Yr])
Using the actual numbers from my table, the calculation ends up being: (1,439,699 - 1,514,506) / 1,514,506 * 100 
Power BI ends up with -29.61%.
However, when I do this same calculation on a calculator, the end result is -4.94%. 
Now, here's the odd part... If I add the columns in a visual table, Power BI gets the same result as my calculator. 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

So, it turns out, I was able to resolve this by going in the direction of all the help on this thread. I not only applied the year as a filter on the page, but also applied the months as a filter on the page as well. By choosing not to include the month of Oct. which is not complete yet, the measure calculates the percentage correctly. Thank you all who contributed. 

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

So, it turns out, I was able to resolve this by going in the direction of all the help on this thread. I not only applied the year as a filter on the page, but also applied the months as a filter on the page as well. By choosing not to include the month of Oct. which is not complete yet, the measure calculates the percentage correctly. Thank you all who contributed. 

HoangHugo
Solution Specialist
Solution Specialist

Hi, the calculation is right, may be error from TableA[Measure_Total_Sum_Prior_Yr]. Can you share detail DAX of measure, and time table you are using.

 

Anonymous
Not applicable

Thanks for your reply. 

There are 2 measures associated with this particular measure. They are:

Total Transactions = Sum(TableA[Transactions])

Total Transactions Prior Yr = 
  CALCULATE(TableA[Total Transactions], PARALLELPERIOD('Calendar'[Date],-12,MONTH))

 

The Calendar Table is a standard Calendar table I use with all reports. 

When I add the months to the visual table (mentioned above), the row totals are all correct. 

Here's a screenshot of the actual report: 

Screen Shot 2022-10-12 at 8.04.04 AM.png

Hi,

From the Calendar Table, drag the Year field in a slicer and select 2022.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thank you for your reply, but I did not mention, I already had a filter on the page for 2022. Never the less, I also added a slicer and still received the same results. 

Screen Shot 2022-10-13 at 10.02.46 AM.png

Hi, I understand you want to calculate YOY%, so need to calculate result of current Year to Date, try this one

 

Measure result of YTD = CALCULATE([Total Transaction], DATEYTD('Calendar'[Date]))

Measure result of Prior Year =CALCULATE(TableA[Total Transactions], PARALLELPERIOD('Calendar'[Date],-12,MONTH))

 

then, use your orginal formula to calculate %difference 

 

Anonymous
Not applicable

Thank you, but as you can see above, I am already utilizing a date slicer and originally had used a date filter on the page. So, the total already reflected YTD. 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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