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
sapirmarko
Helper I
Helper I

percent from total - remove slicers

hi!

I want to build a DAX measure that calculate % of the total quantity

in this report, I have slicers of date, territory, and product category(will be single select).

every time I pick one category  I want to get the percent from total:

sapirmarko_0-1675171554073.png

for example, if I pick CSD I want to get 85% -  2.2M / 2.6 M

important thing- I want that the date slicer will affect the measure, but if I pick another territory I want that the answer won't change. 

 

model looks like :

sapirmarko_1-1675171921461.png

 

 

5 REPLIES 5
olgad
Super User
Super User

It changes because the nominator changes too.
that shall be your nominator

Calculate(Sales[Sales], ALL(Wholesalers[territory_name]))

Not sure what you want to achieve, but if you dont want the slicer to affect that visual at all you can simply set edit interactions to none. 

DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

I need to get the total sales that only the date slicer will affect about this measure, I can't dit interactions to none because it's part od another measure that need use with the other slicers

Fine, have you tried to change the nominator as suggested?


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime
olgad
Super User
Super User

%=DIVIDE([Quantity Principal],  Calculate([Quantity Principal], All(WHS[TerritoryName])))
You need All to remove the filter from Territory

DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

If we break it down into factors, then I calculate the denominator in the following way:

CALCULATE(
[Quantity - Principal],
KEEPFILTERS(Sale_Out[paid_date]),
ALL(Product1[category_name]),
ALL(Wholesalers[territory_name]))
 
when I filter the category_name the answer doesn't change -  that good
when I filter the paid_datethe answer change -  that good
but when I filter the territory_namethe answer change -  that not good

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