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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Nishantp
Regular Visitor

Value in a matrix as a percentage of another row value

I have a typical profit and loss table (very simplified and dummy data version) that looks like this:

MonthTypeActualBudgetVariance
JanuaryInternet sales500000525000-25000
JanuaryStore sales65000060000050000
JanuarySales all-up1150000112500025000
JanuaryProduct cost80000078500015000
JanuaryWeb fees800006000020000
Januarystore rent1200001200000
JanuaryIncome150000160000-10000
FebruaryInternet sales52500051500010000
FebruaryStore sales62500060000025000
FebruarySales all-up1150000111500035000
FebruaryProduct cost79500078500010000
FebruaryWeb fees750006000015000
Februarystore rent1200001200000
FebruaryIncome16000015000010000

 

I want to show this in PowerBI as a matrix that would look something like this:

TypeActual% of total salesBudget% of total sales_Variance
Internet sales1025000 1040000 -15000
Store sales1275000 1200000 75000
Product cost1595000 1570000 25000
Web fees155000 120000 35000
store rent240000 240000 0
Income310000 310000 0

 

By default the data is summation of all the months e.g. internet sales is internet sales for Jan + Feb. But there will be a slicer that allows the user to filter on any month or see multiple months at the same time.

 

The question: How do I show the column % of total sales? What I need is for PowerBI to take the value of the actual for internet sales and divide that by total sales for that time period and do that for all the rows.

1 ACCEPTED SOLUTION

Hi Parry2k,

 

I was able to make it work by creating only one measure. the formula I used was:

% of Actual Total Sales = DIVIDE ( SUM ( table[Actual] ), CALCULATE ( SUM ( Table[Actual]),Table[type]="Sales all-up"))

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@Nishantp you can surely do it but you don't want to do the SUM measure again and again. Also recycle the measure, that's why I created a SUM measure and used at both the place. End of the day it doesn't matter but as a best practice it is good to recycle/reuse, and it is more scalable and manageable.

 

Better to avoid shortcuts and makes the habits of creating scalable solution following best practices.

 

 

Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



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.

Ashish_Mathur
Super User
Super User

Hi,

Not clear of what you want.  In the second table, you have shown % in the title but are adding absolute values under that column.  Why? 


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

Hi Ashish,

 

In the second table, for the % of total sales..I need to show values. I am not showing anything right now. The idea is that for every type (internet sales, product cost, rent, etc.) we need to show the number and next to it what is is in terms of % of total sales. Showing the actual number for internet sales is easy as it is coming from the table but % of total sales should be sum (internet sales) / sum (sales all-up) and then for rent it woudl be sum (rent) / sum (sales all-up)...so on.

I believe I will have to create a measure for % of total sales and have it as a value in the matrix. I have seen some folks do that but I am not able to create one measure that will calculate correct values for every row.

Hope I am making sense.

parry2k
Super User
Super User

@Nishantp here are the measures for actual and you can apply for the rest

 

Actual = SUM ( Table[Actual] )

% of Actual Total Sales = DIVIDE ( [Actual], CALCULATE ( [Actual], ALLSELECTED( Table[Type] ) ) )

 

Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



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.

Hi Parry2k,

 

I was able to make it work by creating only one measure. the formula I used was:

% of Actual Total Sales = DIVIDE ( SUM ( table[Actual] ), CALCULATE ( SUM ( Table[Actual]),Table[type]="Sales all-up"))

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors