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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Problem with the totals when a percentage is in it

Hi,

I have a calculated measure (Let's call it A) that is being displayed in a matrix in Power BI with the rows which are countries. We are filtering the countries so only a few are shown. My problem is that the total of the column is wrong:

 A
Italy99291,10
Brazil1569087,53
Total1679632,91

 

  The formula for A is:

A = DIVIDE(
                   CALCULATE(B,'C'[C1]="ABC"),
                   CALCULATE([D %])
)
B and D are other calculated measures. B returns a number but D returns a percentage. The formula for D is:
D = Divide(E, F)
 
When I put all B,D,E,F also in the matrix the total of all of them works correclty but not for the A.
 
How can I fix this?
1 ACCEPTED SOLUTION

Hi, @Anonymous 

 

You can try the following methods.

Measure = 
Var _table=SUMMARIZE('Table','Table'[Countries],"Sum",[A])
Var _Sum=SUMX(_table,[Sum])
Return
IF(HASONEVALUE('Table'[Countries]),[A],_Sum)

For reference:

Solved: wrong total of measure - Microsoft Power BI Community

Hope this helps.

 

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.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

This did solved it. And I also understand why. Thanks

Anonymous
Not applicable

I just checked and found out this:

CountriesABD %
Italy99291,105340253.78%
Brazil1569087,53107710768.65%
Total1679632,91113050967.31%

 

So, Although the sum of the column A rows doesn't add up to A's total but it seems that if I use the formula on the total of B and divide it by the total of D %, The result can match to total of A. But how can I change the total of A so that it just calulcates the actual sum of it's rows?

 

Hi, @Anonymous 

 

You can try the following methods.

Measure = 
Var _table=SUMMARIZE('Table','Table'[Countries],"Sum",[A])
Var _Sum=SUMX(_table,[Sum])
Return
IF(HASONEVALUE('Table'[Countries]),[A],_Sum)

For reference:

Solved: wrong total of measure - Microsoft Power BI Community

Hope this helps.

 

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.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.