The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi, I have the below matrix table (cannot show first row, but it is an Account Name with Indiviaul Purchases underneath):
The income percentage formula I used is DIVIDE( Income, Cost ).
As you can see, they aren't calculating correctly. For example, the third row should show 23.86% but it is returning 28.76%. I have it set to show the Average, as this is the closest result. Does anybody have any idea what's causing this?
Thank you.
Solved! Go to Solution.
Hi @GeorgeG
Just like amitchandak has replied, you need to build a measure. And you need if function to make your result see 0.
I build a table like yours.
Measure:
Income Percentage =
VAR _A = DIVIDE(SUM('Table'[Income]),SUM('Table'[Cost]))
Return
IF(_A=0,0,_A)
Result:
You can download the pbix file from this link: Percentages aren't calculating correctly
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @GeorgeG
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Rico Zhou
Hi,
I found the issue that was causing this. I have a rather large dataset in which the Account Names are connected to multiple figures underneath. It looks like it was calculating the percentage of other figures against the Account Name, to fix this I selected the following options within PowerBI:
@GeorgeG , Can you share the formula,
hope it
divide(Sum(Table[Income]),sum(Table[Cost]))
not
average(divide((Table[Income]),(Table[Cost])))
Hi @amitchandak , the formula is as follows:
DIVIDE(
(Table[Income]),
(Table[Cost])
)
If I add SUM to the formula, the below is shown:
This is with the Average option selected, either option returns incorrect (If I use the SUM option, it shows over 300% for all rows):
Thank you.
Hi @GeorgeG
Just like amitchandak has replied, you need to build a measure. And you need if function to make your result see 0.
I build a table like yours.
Measure:
Income Percentage =
VAR _A = DIVIDE(SUM('Table'[Income]),SUM('Table'[Cost]))
Return
IF(_A=0,0,_A)
Result:
You can download the pbix file from this link: Percentages aren't calculating correctly
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@GeorgeG , Create a measure like
DIVIDE(
sum(Table[Income]),
sum(Table[Cost])
)
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
118 | |
87 | |
75 | |
53 | |
45 |
User | Count |
---|---|
135 | |
121 | |
77 | |
65 | |
64 |