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
SuchCT
Helper II
Helper II

Ignore a single slicer on a measure

Hello,
I currently have a page with several slicers from different tables(they all have relationships).
But I'm trying to find the percentage of Weight this Product represents of the total Weight given all the selected slicers. So I´d need both a Weight affected by every filter. And a Weight that´s affected by every filter besides Product.

For Example this my full table. If I needed what percentage of Green Product C was sold in USA out of the total Weight. I´d need:
-Weight of C (Affected by Product, Color, Country) = 1
-Total Weight (Affected by Color, Country but NOT Product) = 33

Measure Result=1/33

Product         Model       Color          Weight     Country

A                      2               Green            9                USA         
C3Green1USA
A2Red6MEX
C2Green1MEX
B2Green8USA
B1Red9CAN
A1Green4MEX
A1Red9CAN
B1Blue7MEX
C1Red9CAN
A2Green10USA
B2Blue5MEX
C3Blue4MEX
C1Blue1MEX
A3Red1USA
B2Green5USA
B3Green10MEX
C3Blue9CAN
C2Green2MEX
B3Green7MEX


Thanks in advance

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @SuchCT ,

 

For this you need to use the ALLEXCEPT using the two columns you need:

Weight for product = 
DIVIDE (
    SUM ( 'Table'[Weight] ),
    CALCULATE (
        SUM ( 'Table'[Weight] ),
        ALLEXCEPT ( 'Table', 'Table'[Country], 'Table'[Color] )
    )
)

 

Check result below:

MFelix_0-1634894157264.png

 

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

8 REPLIES 8
MFelix
Super User
Super User

Hi @SuchCT ,

 

For this you need to use the ALLEXCEPT using the two columns you need:

Weight for product = 
DIVIDE (
    SUM ( 'Table'[Weight] ),
    CALCULATE (
        SUM ( 'Table'[Weight] ),
        ALLEXCEPT ( 'Table', 'Table'[Country], 'Table'[Color] )
    )
)

 

Check result below:

MFelix_0-1634894157264.png

 

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



This one sort of works. I can´t really add everything I need because the filters interact with each other, so it's not as easy as too just add them on ALLEXCEPT.

I'll accept it as solution as to help anyone else. Thanks for the help.

Hi @SuchCT ,

 

What do you mean "sort of works" were is this lacking the flexebility you need?


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



I think the problem comes from the iflters interacting with each other. I have a lot of slicers on this page. Continuing with the example if I were to filter by "Color" and "Model" on the slicers that would automatically modify the other slicers. 
So now, eventhough I added "Color" and "Model" to ALLEXCEPT, the other parameters ("Country" and "Products") are being modified as well.
The workaround I found is to just add to the ALLEXCEPT the Fields that remain constant, the more "general" ones.

Excuse me if I'm not expressing myself clearly, english is not my first language.

Hi @SuchCT ,

 

This can happen when you use a single table for your data, because the filtering impacts other slicer the option would be to have disconnected tables for the slicer and then make the calculation using the values selected on those slicers but that would also give you some other issues.

 

(no problem about the english is not mine first language also).

 

If you need anything else please tell me.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thanks for your reply, I found that method and am using it right now. But I was looking for a more "hands off" solution. In case in the future someone needs to add a new filter, they don't have to modify the measure.
If that's not possible I'll accept your post as solution. Thanks again.

Hi @SuchCT ,

 

In this case you need to use the following syntax:

Weight for product = 
DIVIDE (
    SUM ( 'Table'[Weight] ),
    CALCULATE (
        SUM ( 'Table'[Weight] ),
        ALL ( 'Table'[Product] )
    )
)

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Try:

 

Weight for product = 
DIVIDE (
    SUM ( 'Table'[Weight] ),
    CALCULATE (
        SUM ( 'Table'[Weight] ),
        ALL ( 'Table', 'Table'[Product] )
    )
)

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.