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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Tmatti92
New Member

Profit Margin

Hi there, 

 

i am working with summary data and im tyring to calculate Profit Margin which is called "EM" in my data model. The calculation itself is correct but the total is not. I would like it to round to 100%

 

I do not have any cost data so im simply doing Profit/revenue

 

Here is a screenshot:

Tmatti92_0-1632139302587.png

 

Regards,

Thomas

1 ACCEPTED SOLUTION

@Tmatti92 Try:

m_Total 3
VAR __table = SUMMARIZE(Sales,[Grade],[Service],[Region],"__Value",[m_Single])
RETURN
IF(HASONEVALUE(sales[Region]),[m_Single],SUMX(__table,[__Value]))

@ 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

3 REPLIES 3
Greg_Deckler
Super User
Super User

@Tmatti92 This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


@ 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...

@Greg_Deckler  Hi Greg thanks for your reply. I am still seeming to struggle with calculating the % i have tried using your thread but am still having some errors.  

 

firstly i tried this:

 

m_Single = SUM(Sales[EM])

 

Then secondly this

m_Total 3

VAR __table = SUMMARIZE(Sales,[EM],[m_Single])
RETURN
IF(HASONEVALUE(sales[em]),[m_Single],SUMX(__table,[em]))
 
Would be great if you could point out my error. As i can imagine it's an easy fix which i am not seeing.
 
Regards,
Thomas

@Tmatti92 Try:

m_Total 3
VAR __table = SUMMARIZE(Sales,[Grade],[Service],[Region],"__Value",[m_Single])
RETURN
IF(HASONEVALUE(sales[Region]),[m_Single],SUMX(__table,[__Value]))

@ 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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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