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
EpicTriffid
Helper IV
Helper IV

Help explaining % of row total formula

Hi all,

 

I'm a new user to PBI and a colleague of mine was asking for some help on calculating the % of Row Total in a bar chart, which wasn't being presented to him as an option in the list of "show value as". We came across this formula online:

 

Measure = CALCULATE(SUM(Sheet1[ID]))/CALCULATE(SUM(Sheet1[ID]),ALL(Sheet1[Status]))

 

This makes it work beautifully, but for the life of my I can't work out why. Would someone be so kind as to explain it in laymens terms? Why would I divide the total by the total? Thankyou!

 

Matt 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@EpicTriffid 

 

Two part of this, first part  CALCULATE(SUM(Sheet1[ID])) calculates the sum based on fitler context and

2nd part CALCULATE(SUM(Sheet1[ID]),ALL(Sheet1[Status])) sum of all the values and ALL function remove any filters

which allos to get total

 

Assume you have two columns Category and Sales

A 100

A 100

B 200

B 200

C 400

 

Total sales is = 100 + 100 + 200 + 200 + 400 = 1000

 

Assume you have category on X axis and % formula on values to show the bar

 

So when it is showing % for category A , it is SUM of sales of category A which is 100 + 100 = 200 and 2nd part

is doing total sales which is 1000 and % would be 200 / 1000

 

and when it is category B, sum of category B is 200 + 200 = 400 and % will be 400 / 1000 , so on...

 

hope it helps.

 



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.

View solution in original post

1 REPLY 1
parry2k
Super User
Super User

@EpicTriffid 

 

Two part of this, first part  CALCULATE(SUM(Sheet1[ID])) calculates the sum based on fitler context and

2nd part CALCULATE(SUM(Sheet1[ID]),ALL(Sheet1[Status])) sum of all the values and ALL function remove any filters

which allos to get total

 

Assume you have two columns Category and Sales

A 100

A 100

B 200

B 200

C 400

 

Total sales is = 100 + 100 + 200 + 200 + 400 = 1000

 

Assume you have category on X axis and % formula on values to show the bar

 

So when it is showing % for category A , it is SUM of sales of category A which is 100 + 100 = 200 and 2nd part

is doing total sales which is 1000 and % would be 200 / 1000

 

and when it is category B, sum of category B is 200 + 200 = 400 and % will be 400 / 1000 , so on...

 

hope it helps.

 



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.

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.

Top Solution Authors