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
tblackwell311
New Member

How to divide values using total of same column - filtered

Hello,

 

I need to create a measure that returns the "% of total" in green, not the "% of total in red".

 

RegionItemPriceQuantityDollars % of Total
% of Total
Kansas CityHamburger$1.004$4.00 20.0%13.3%
Kansas CityCheeseburger$1.504$6.00 30.0%20.0%
Kansas CityDouble Cheeseburger$2.005$10.00 50.0%33.3%
St. LouisHamburger$1.001$1.00 10.0%3.3%
St. LouisCheeseburger$1.502$3.00 30.0%10.0%
St. LouisDouble Cheeseburger$2.003$6.00 60.0%20.0%

 

My formulas

Sales = sum(Table1[Dollars])
Total Sales = CALCULATE(sum(Table1[Dollars]),ALL(Table1))
% of Total = CALCULATE(DIVIDE([Sales],[Total Sales]))
 
My result is the % of total in red.
 
What I want is the % of total in green, which is the filtered % of total.
 
Please note that I am using a slicer.
 
Capture.PNG

 

1 REPLY 1
HotChilli
Super User
Super User

If you rewrite the Total Sales measure as

Total Region Sales = CALCULATE(SUM(Table1[Dollars]), ALLEXCEPT(Table1, Table1[Region]))

and use that as the denominator, it should get your result.

Format it as a %.

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