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
Anonymous
Not applicable

Filter group

Hi all,

 

I have one I am struggling to even explain so I hope this little diagram might help. 

There is data that I want to be able to filter with a slicer but some of it is in more than one filter type, I cannot think of a way to do this, any ideas?

 

Made up data:
Column1 - Column2
134324 - Type 1
324234 - Type 1
545345 - Type 3
435345 - Type 2
353454 - Type 3
435344 - Type 3
453453 - Type 2
345324 - Type 1

 

The the "filters" or slicer
Filter 1 = Show only Type 1
Filter 2 = Show both Type 2 AND Type 3
Filter 3 = Show only Type 3

 

It is this second Filter 2 where I am struggling with.

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can create a new table to put the slicer.

9.png10.png

 

Then create a measure.

New Column = 
SWITCH (
    SELECTEDVALUE ( 'Table (2)'[Slicer] ),
    "Filter 1 = Show only Type 1", CALCULATE ( SUM ( 'Table'[Column1] ), FILTER ( 'Table', [Column2] = "Type 1" ) ),
    "Filter 2 = Show both Type 2 AND Type 3",
        CALCULATE (
            SUM ( 'Table'[Column1] ),
            FILTER ( 'Table', [Column2] = "Type 2" || [Column2] = "Type 3" )
        ),
    "Filter 3 = Show only Type 3", CALCULATE ( SUM ( 'Table'[Column1] ), FILTER ( 'Table', [Column2] = "Type 3" ) )
)

 

The result is as follows.

11.png12.png13.png 

 

You can check more details from here.

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can create a new table to put the slicer.

9.png10.png

 

Then create a measure.

New Column = 
SWITCH (
    SELECTEDVALUE ( 'Table (2)'[Slicer] ),
    "Filter 1 = Show only Type 1", CALCULATE ( SUM ( 'Table'[Column1] ), FILTER ( 'Table', [Column2] = "Type 1" ) ),
    "Filter 2 = Show both Type 2 AND Type 3",
        CALCULATE (
            SUM ( 'Table'[Column1] ),
            FILTER ( 'Table', [Column2] = "Type 2" || [Column2] = "Type 3" )
        ),
    "Filter 3 = Show only Type 3", CALCULATE ( SUM ( 'Table'[Column1] ), FILTER ( 'Table', [Column2] = "Type 3" ) )
)

 

The result is as follows.

11.png12.png13.png 

 

You can check more details from here.

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

That is perfect! Thank you very much 🙂

 

I am sorry for the very long delay in marking as the solution, I got side tracked.

 

Thanks again, this is very much appreciated.

parry2k
Super User
Super User

@Anonymous not sure what you mean show type 2 and type3? do you want these options to show in the slicer/filter? What you are trying to do?



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.

Anonymous
Not applicable

Hi,

 

Yes it is a bit tricky to explain 😞

 

I need the slice to be able to like show an OR condition I guess. Show if the match is one OR another. 

Is this possible?

 

If an option is selected then filter for type 1 or type 2.

Anonymous
Not applicable

Any ideas? I am still no closer to an idea how this would work.

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.