Forum Discussion
Calculating Margin %
Dear Experts
I am new with Power BI so I really need help here. Forgive me if this had been answered somewhere else but I cannot seem to find a solution around.
I want to create a graph to show the total profit margin for individual customer.
Here is an example of my file
| Customer Name | Total Selling | Profit | Margin % |
| AAA | 1,288 | 851 | 66% |
| BBB | 121 | 44 | 37% |
| CCC | 88 | 34 | 38% |
| CCC | 32 | 10 | 30% |
| CCC | 11 | 3 | 30% |
| CCC | 154 | 46 | 30% |
| DDD | 10 | 2 | 23% |
| DDD | 13 | 2 | 13% |
However when it comes out in the graph here is what it looks like
I have changed the column type to % but it doesnt show as % in my graph. Also the number is wrong so perhaps it added up all my margin together?
Please help me to solve this. I hope my request is clear enough to understand.
If there is any information I can provide please let me know!
Hi Yuiitsu ,
One custmer may have multi margins%, so if we sum them, we may got a 38%+30%+30% for customer C, if you want to get the result (3+10+34)/(11+32+88)=35.8%, we can create a measure as the value fileld to meet your requirement:
Margin % Measure = DIVIDE ( SUM ( 'Table'[Profit] ), SUM ( 'Table'[Total Selling] ) )
Best regards,
6 Replies
- AnonymousNot applicable
You want to save a percentage as a decimal and then label it as percentage in modelling tab. 0,66 = 66%. The way you have it now is 66% = 6600% (66*100).
Im not sure whats going on in your visual, but i advice you to change this first and then take a look at the visual. If its still not working please post the setup of the visual, what fields are where on what aggregation etc.- YuiitsuHelper V
Is this what you meant?
Thanks for your reply earlier!
- AnonymousNot applicable
Yes, thankyou, in the value field you see count of margin, this should be set to dont summarize. Also, did you chance the data to 0,66 instead of 66%?