Forum Discussion
Calculating Gross Profit Margin
Hi:
For Microsoft Dynamics 365 Business Central, I'm using the Chart of Accounts table and I'd like to calculate gross profit margin by subtracting cost of goods sold from revenue and dividing that figure by revenue.
How do I calculate this and place it in a report in Power BI?
Thanks!
John
Anonymous ,
If they are coming from two tables
calculate(divide((sum(Table2[revenue])-sum(Table1[COGS])),sum(Table2[revenue]))
From one table
calculate(divide(sumx(Table[revenue]- Table[COGS]),sum(Table[revenue])))
3 Replies
- Greg_Deckler
Community Champion
I wrote a quick measure for gross margin: https://community.powerbi.com/t5/Quick-Measures-Gallery/Gross-Margin-Revenue-and-Cost-GMRC/m-p/584437#M275
Sample data would help. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- amitchandak
Super User
Anonymous ,
If they are coming from two tables
calculate(divide((sum(Table2[revenue])-sum(Table1[COGS])),sum(Table2[revenue]))
From one table
calculate(divide(sumx(Table[revenue]- Table[COGS]),sum(Table[revenue])))
- AnonymousNot applicable
Thanks, for responding!
This still doesn't work, really.
The following is what my report currently looks like, and the table is called Chart_of_Accounts. If you can please modify your answer, that would be awesome! 😀
Account Category Balance Account No
Cost of Goods Sold 500000 50000
Income 700000 40000
Income 20000 41000
John