Forum Discussion
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:
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]))
3 Replies
- Greg_DecklerCommunity Champion
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- Tmatti92New Member
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])RETURNIF(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- Greg_DecklerCommunity Champion
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]))