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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Jonas_Bertels
New Member

Calculating a % on a row subtotal based on a calculated column

Hi,

I have the created a calculated column which takes a profitability % as follows: (Revenues-costs)/Costs-1, as percentage.

This goes without any issues in the data table, but when I try to visualize this in a matrix, I get the following issue:

Cost                         Revenue          Profitability

Jonas_Bertels_0-1599055295624.png

The individual % are correctly calculated. What I would like to have, is that the subtotal, the line in bold, is taking the same formula and calculating it on the sums of the costs and revenues of the individual parts.

 

Could anyone help me out on how to correctly use PowerBI for this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Jonas_Bertels ,

 

When you put the calculated column into the matrix, the subtotal is the sum of your calculated column.

534.92%+121.30%+(-100%)=556.22%.

It is suggested to try this measure instead of the calculated column.

Profitability =
DIVIDE (
    SUM ( 'Table'[Revenue] ) - SUM ( 'Table'[Cost] ),
    SUM ( 'Table'[Cost] )
)

6.png

 

You can check more details from here.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Jonas_Bertels ,

 

When you put the calculated column into the matrix, the subtotal is the sum of your calculated column.

534.92%+121.30%+(-100%)=556.22%.

It is suggested to try this measure instead of the calculated column.

Profitability =
DIVIDE (
    SUM ( 'Table'[Revenue] ) - SUM ( 'Table'[Cost] ),
    SUM ( 'Table'[Cost] )
)

6.png

 

You can check more details from here.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This is exactly what I needed, Thank you Stephen!

ryan_mayu
Super User
Super User

@Jonas_Bertels 

you can try

percentage = 

if(ISFILTERED('Table'[type]),[revenue_cost]/[_cost]-1,SUMX('Table',[revenue_cost]/'Table'[cost]-1))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@Jonas_Bertels , if they are columns try like

divide(Sum(Table[Revenues-costs]) -Sum(Table[Costs]) , Sum(Table[Costs]))

if measure try like
divide((Table[Revenues-costs]) -(Table[Costs]) , (Table[Costs]))

 

Also refer :https://www.youtube.com/watch?v=ufHOOLdi_jk

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Greg_Deckler
Community Champion
Community Champion

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



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.