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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Custom slicer / slicer combined with if conditions

Hello everyone,

 

i am fairly new to Power BI and currently struggeling with the following issue. 

I have a table with lots of numbers, each number is individual, there is one column which gives each number a value like A, B, C so on...

Now i want to categorize these numbers in classes, class 00 contains the values A and B, class 01 contains B,D, class 02, contains A and C so on.

These classes are supposed to be used in a slicer.

My problem is that i cant just create a new column for the classes because there are parts which are supposed to be in two or even more classes. 

What (i think) i need is a slicer where i can use if conditions to "tell the slicer" which values are supposed to be displayed.

Maybe there is another, even simpler solution?

I hope i explained my problem clearly, as english is not my first language.

 

Thanks in advance.

Regards!

4 REPLIES 4
mahoneypat
Microsoft Employee
Microsoft Employee

Easiest might be to add a table to your model that has a Class Column and your Values column (A, B, C).  Each Class would have a row for all the Values in it.  You can then relate that table to your primary table, and use the Class column in your slicer.  It would be a many-to-many relationship, but you can set the filter to go just one way (from new table to primary table).  Multiple other approaches possible too.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hello,

 

unfortunately i stumbled across another problem.

I now have several columns in the main table with the A, B, C values and i tried to create a column in the class table for each new column but unfortunately i cant create a second relationship between the tables. 

The values A, B, C... still belong to the same classes, but for each individual number in the main table a number can have the value A in the first column and value C in the second. 

Is there a solution to combine these columns into one slicer?

Thanks in advance.

Anonymous
Not applicable

Thank you very much, that worked very well, i  somehow completely overlooked the possibility to create an extra table.

Hi , @mahoneypat 

If your category does not contain duplicate elements(which are  not supposed to be in two or even more classes. ), perhaps using the group function will be simpler.

47.png

 

But as far as the examples you provide so far are concerned, no doubt @mahoneypat solution will be better.

 

Here is a demo.

pbix attached

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors