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

How to create more than one group that include the same value, using a slicer?

Hi, I am looking to have a slicer that filters by multiple clients. This is simple enough, however, what if a group contains Clients that are in another Group?

 

For example,

Group 1: Alpha, Bravo, Charlie

Group 2: Delta, Echo

Group 3: Alpha, Charlie, Echo

 

I want to be able to use a drop down slicer that you can select from Group 1, 2 and 3. This is currently how I have the first two Groups setup, but how can I create the third:

 

Groups =
if(find("Alpha",Clients[Name],,-1)>0,"Group 1",
if(find("Bravo",Clients[Name],,-1)>0,"Group 1",
if(find("Charlie",Clients[Name],,-1)>0,"Group 1",

 

if(find("Delta",Clients[Name],,-1)>0,"Group 2",

if(find("Echo",Clients[Name],,-1)>0,"Group 2",

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

Hi,

 

Please take following steps:

1)Create a group slicer table as below by Enter Data:

11.PNG

2)Try this measure:

Measure = 
SWITCH (
    SELECTEDVALUE ( 'Table 2'[Groups] ),
    "Group 1", IF ( SELECTEDVALUE ( 'Table'[Clients] ) IN { "Alpha", "Bravo", "Charlie" }, 1 ),
    "Group 2", IF ( SELECTEDVALUE ( 'Table'[Clients] ) IN { "Delta", "Echo" }, 1 ),
    "Group 3", IF ( SELECTEDVALUE ( 'Table'[Clients] ) IN { "Alpha", "Charlie", "Echo" }, 1 )
)

3)Apply this measure to the original table by setting measure=1.

  When selecting one value in group slicer, the result shows:

12.PNG

See my attached pbix file.

 

Best Regards,

Giotto

View solution in original post

3 REPLIES 3
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please take following steps:

1)Create a group slicer table as below by Enter Data:

11.PNG

2)Try this measure:

Measure = 
SWITCH (
    SELECTEDVALUE ( 'Table 2'[Groups] ),
    "Group 1", IF ( SELECTEDVALUE ( 'Table'[Clients] ) IN { "Alpha", "Bravo", "Charlie" }, 1 ),
    "Group 2", IF ( SELECTEDVALUE ( 'Table'[Clients] ) IN { "Delta", "Echo" }, 1 ),
    "Group 3", IF ( SELECTEDVALUE ( 'Table'[Clients] ) IN { "Alpha", "Charlie", "Echo" }, 1 )
)

3)Apply this measure to the original table by setting measure=1.

  When selecting one value in group slicer, the result shows:

12.PNG

See my attached pbix file.

 

Best Regards,

Giotto

Mariusz
Community Champion
Community Champion

Hi @GeorgeG 

 

If you Alpha, Bravo, Charlie is a full customer name, not a part that you need to find then you can simply use Measure Option One else if Alpha, Bravo, Charlie is a text that you need to find within the customer name then Measure Option Two is the option for you.

 

Both Measures can be found on the attached.

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
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.