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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Control a Measure using Multi Selction Disconnected Slicer

Hi

I'm trying to understand how to do the above.

 

What I want to achieve is best exampled by the following:

PowerBI.PNG

 

So I want to choose multiple selections on the blue slicer to affect the blue line, and multiple selections on the yellow slicer to affect the yellow line. I have this working for single selections.

 

Here is a link to a less complex example pbix file, based on fruits, and a line chart with just one line and slicer - if I can get that working properly, I can achieve the above.

 

Example.PBIX

 

This is an example of what it should look like, but with three normal slicers - it shows a total of 5 fruits which are Hard and from France, which is correct:

PowerBI_9.PNG

 

The problem is these slicers affect the visual, not the measure, which means if I plot a second measure on the same visual, it will be affected by the same selections. I want a second measure to be affected by a different slicer and set of selections.

 

So I have, with help from others on here, developed a disconnected slicer based on a slicer table with all of the values in that I might want to slice on, and a duplicate table with the features I want to slice on unpivoted, which gives me this set up, using the following measure:

 

Line 1 = CALCULATE([Number of Rows],FILTER(Duplicate,Duplicate[Value] in values(Slicer[Value])))

 

PowerBI_10.PNG

I've added a matrix visual in to show what is happening - it is basically acting a bit like an or - i.e. giving me all fruits that are either hard or from France (but only counting the ones that are both once). What I want it to plot is just the 5 that is highlighted at the intersection between France and Hard. As I say, easy to achieve with multiple slicers affecting a visual, but I want the slicer to affect the measure, not the visual. This does but in the wrong way.

 

Sorry for the long post, but I wanted to ensure that I communicated the problem effectively.

 

Many Thanks

 

Ian

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks, @v-cherch-msft  - that would have worked I think, but I have multiple features I want to slice on, and this would involve creating a slicer table for each feature, which would have got hard to maintain.

The solution, in the end, came from my boss who had a play and worked out it was best done by creating two datasets in Power Query from one, and then having a measure in each dataset that is plotted on the visual. That way you don't need any slicer tables - you slice on the values in each dataset - I've tested and it works.

 

The link is here to the solution - Final Solution

 

Thanks again

View solution in original post

2 REPLIES 2
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous 

It seems you may create two slicer tables and then create the measure like below.Please check Page1 in attached file.

Measure =
CALCULATE (
    [Number of Rows],
    FILTER (
        Fruits,
        Fruits[Country] IN VALUES ( Country_Slicer[Country] )
            && Fruits[Feature] IN VALUES ( Feature_Slicer[Feature] )
    )
)

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks, @v-cherch-msft  - that would have worked I think, but I have multiple features I want to slice on, and this would involve creating a slicer table for each feature, which would have got hard to maintain.

The solution, in the end, came from my boss who had a play and worked out it was best done by creating two datasets in Power Query from one, and then having a measure in each dataset that is plotted on the visual. That way you don't need any slicer tables - you slice on the values in each dataset - I've tested and it works.

 

The link is here to the solution - Final Solution

 

Thanks again

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.