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
pat1214
Frequent Visitor

Grouping states in slicer

Hello,

I have a field in my table called 'Location' which has different US states, US Territories and International. I created a slicer for 'Location' so the end user can view student enrollments by different states etc. I need to be able to group all the states under 'States', if it is a US Territory, then 'US Territory' else 'International'. So essentially in my slicer, I will have just 'states', 'US Territories' and 'International'. 'States' would drop down to show selections for all 50 states. Hope this makes sense! Picture 1 is how the field in the table looks like. Thank you!

Capture.JPG

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

HI @pat1214 ,

Unfortunately, you can't direct grouping your data in the slicer.
I'd like to suggest you add a custom column with switch function or if statement to manually setting groups for your records. Then you can use them to create a hierarchy field and use it in custom visual hierarchy slicer.

How to create and use a Power BI Hierarchy 

HierarchySlicer 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @pat1214 ,

Unfortunately, you can't direct grouping your data in the slicer.
I'd like to suggest you add a custom column with switch function or if statement to manually setting groups for your records. Then you can use them to create a hierarchy field and use it in custom visual hierarchy slicer.

How to create and use a Power BI Hierarchy 

HierarchySlicer 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
JosefPrakljacic
Solution Sage
Solution Sage

Hey @pat1214 ,

 

you switch to the Power Query Editor (by pressing edit queries).

There you add a new "Conditional Column" where you write the conditions you have described here.

 

Then you put the new created column into your slicer.

 

Finito

 

If this post was helpful may I ask you to mark it as solution and give it a 'thumbs up'? This will also help others

Have a nice day!

BR,
Josef
Graz - Austria

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.