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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Rob4848
Regular Visitor

Expense as % of Revenue - Matrix

Hi - I've been struggling with this  for a while.  It seems close to other posts, but I can't quite figure it out.  Please help.

 

I'm trying to do expense as a % of revenue in a matrix table.  So in this table, I want to divide all expenses and income by the total sales - $102,924 for February, $97,633 for January.  I've been able to make it work for the sum of Jan and Feb together, but not by the individual months.  I'd be grateful for the answer!

 

PowerBIProblem.png

Table1Table1

1 ACCEPTED SOLUTION

Hi,

This measure works

Measure 2 = [Total]/CALCULATE([Total],Table1[L1]="Income",ALL(Table1[L2]))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
v-juanli-msft
Community Support
Community Support

Hi @Rob4848 

Is this problem sloved?

If not, please let me know.

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept Ashish_Mathur 'S answer as the solution to help the other members find it more quickly.

parry2k
Super User
Super User

@Rob4848 add following measures:

 

Total Sales = CALCULATE( SUM( Table[Revenue] ), Table[L1]= "Income")

% of Sales = DIVIDE( SUM( Table[Revenue] ), [Total Sales] )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k - Unfortunately, that doesn't work.  I need somehow for the $102,924 to be repeated down the whole column.  Some sort of aggregation.PowerBIProblem3.png

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

here 'tis

 

https://drive.google.com/file/d/1pJKfqIIDM5EgsEli9_bE3mWed60V6RBJ/view?usp=sharing

 

For a quick fix, I "cheated" and used the query editor to aggregate the data, then match it back.  I would like to see a more gracefull solution where I'm not duplicating data!

 

Thanks,

Rob.

Hi,

This measure works

Measure 2 = [Total]/CALCULATE([Total],Table1[L1]="Income",ALL(Table1[L2]))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks Ashish!  That's brilliant.  I hadn't thought of that.  Sorry for the slow response, I've been away for a bit.

 

R.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.