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

Custom Slicer based on Grouped Cell Values in a column

Hello,

 

I am trying to create custom slicers that allow me to select a "category" instead of a cell value. 

 

This is what I have currently:

abc
a1b1c1
a2b2c2
a3b3c3
a4b4c4
a5b5c5
a6b6c6

 

Suppose b1, b2, b5 belong to "Category 1", b3 and b6 belong to "Category 2", and b4 is "Category 3". I want to create a slicer that has 3 options: Categories 1, 2, and 3, such that it filters my table based on the selected category/categories. 

 

For example, if I select Category 1, the output should be: 

abc
a1b1c1
a2b2c2
a5b5c5

 

How can I achieve this?

 

Thank you. Really appreciate your help!

1 ACCEPTED SOLUTION
Irwan
Super User
Super User

hello @Anonymous 

 

please check if this accomodate your need.

 

1. create a calculated column for categories.

Category =
IF(
    RIGHT('Table'[a],1)="1"||
    RIGHT('Table'[a],1)="2"||
    RIGHT('Table'[a],1)="5"||
    RIGHT('Table'[b],1)="1"||
    RIGHT('Table'[b],1)="2"||
    RIGHT('Table'[b],1)="5"||
    RIGHT('Table'[c],1)="1"||
    RIGHT('Table'[c],1)="2"||
    RIGHT('Table'[c],1)="5",
    "Category 1",
IF(
    RIGHT('Table'[a],1)="3"||
    RIGHT('Table'[a],1)="6"||
    RIGHT('Table'[b],1)="3"||
    RIGHT('Table'[b],1)="6",
    "Category 2",
    "Category 3"
))
Irwan_0-1721164048504.png

 

2. plot your data in table visual and the category column in slicer.

Irwan_1-1721164106475.png

 

Hope this will help you.

Thank you.

View solution in original post

3 REPLIES 3
Irwan
Super User
Super User

hello @Anonymous 

 

please check if this accomodate your need.

 

1. create a calculated column for categories.

Category =
IF(
    RIGHT('Table'[a],1)="1"||
    RIGHT('Table'[a],1)="2"||
    RIGHT('Table'[a],1)="5"||
    RIGHT('Table'[b],1)="1"||
    RIGHT('Table'[b],1)="2"||
    RIGHT('Table'[b],1)="5"||
    RIGHT('Table'[c],1)="1"||
    RIGHT('Table'[c],1)="2"||
    RIGHT('Table'[c],1)="5",
    "Category 1",
IF(
    RIGHT('Table'[a],1)="3"||
    RIGHT('Table'[a],1)="6"||
    RIGHT('Table'[b],1)="3"||
    RIGHT('Table'[b],1)="6",
    "Category 2",
    "Category 3"
))
Irwan_0-1721164048504.png

 

2. plot your data in table visual and the category column in slicer.

Irwan_1-1721164106475.png

 

Hope this will help you.

Thank you.

Anonymous
Not applicable

Yes, this worked perfect. Thank you so much!

hello @Anonymous 

 

glad to be a help.

 

Thank you.

Helpful resources

Announcements
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.

June 2025 community update carousel

Fabric Community Update - June 2025

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