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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Frankcf
Frequent Visitor

percentage total

Hi

I am new to Power BI and found this community to be very informative.

 

I have a table that displays sales by sales person for a specific time

the problem is that when i display tge margin % i f i don't turn off "sum" the values arre incorrect, but with turned off the total line of the report does not display the overall margin %.

 

 

 

 

1 ACCEPTED SOLUTION

I hate to say this without a firm solution, but that is probably your issue with the totals. I noticed this in my Ohio State Football Wins %. The solution was to move the calculation to a Measure and then the totals were correct. I'd have to know a little more about your data to give you a 100% solution, the way that I did my win percentage calculation in my Ohio State Football report was:

 

Winning % = SUM([Wins]) / (SUM([Wins]) + SUM([Losses]) + SUM([Ties]))

Then, the context of the visual would calculate things out correctly. For example, I could put this in a matrix along with Coach and Year and all of the individual rows would be correct as well as all of the totals.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Frankcf
Frequent Visitor

hi i have it as a column with the follwing formula

Margin % = ('posted sales trans_ (2)'[Margin $ (LCY)]/' posted sales trans_ (2)'[Sales (LCY)])*100

I hate to say this without a firm solution, but that is probably your issue with the totals. I noticed this in my Ohio State Football Wins %. The solution was to move the calculation to a Measure and then the totals were correct. I'd have to know a little more about your data to give you a 100% solution, the way that I did my win percentage calculation in my Ohio State Football report was:

 

Winning % = SUM([Wins]) / (SUM([Wins]) + SUM([Losses]) + SUM([Ties]))

Then, the context of the visual would calculate things out correctly. For example, I could put this in a matrix along with Coach and Year and all of the individual rows would be correct as well as all of the totals.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi

I got the margin calculation to work with the following measure

 

Margin % = sum ('posted sales trans_ (2)'[Margin $ (LCY)]/ sum(' posted sales trans_ (2)'[Sales (LCY)])*100

 

this has given the correct margin calculation on the total row of a table.

Greg_Deckler
Super User
Super User

How are you doing your margin %, is it a calculated column or a measure?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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