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
Anonymous
Not applicable

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

1 ACCEPTED SOLUTION
amitchandak
Super User
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])))

View solution in original post

3 REPLIES 3
amitchandak
Super User
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])))

Anonymous
Not 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

 

 

Greg_Deckler
Super User
Super User

I wrote a quick measure for gross margin: https://community.powerbi.com/t5/Quick-Measures-Gallery/Gross-Margin-Revenue-and-Cost-GMRC/m-p/58443...

 

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


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