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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
s_shafiq
New Member

Need a slicer which only shows the unique options in a column with a string separated by commas

Hello,

I have some data which looks like this:
PowerBI problem.png


I need to add a slicer in the report view that only shows SINGULAR options, for example:

Bedfordshire Borough Council

Cambridgeshire County Council

Suffolk County Council

Peterborough City Council

etc.

etc.

 

I CANNOT split the column into additional rows because that will ruin all my visuals. The number of rows MUST remain the same, as each row pertains to a unique road.

 

Any help would be greatly appreciated!!

1 ACCEPTED SOLUTION
DoubleJ
Solution Supplier
Solution Supplier

Hi

Intersting task. I created I sample file but cannot find a way to upload it (wasn't this possible a while ago?). I hope my description and screenshots help.

Steps

  1. You need a unique identifier in your table. If you dont have one create it by adding an index column in Power Query.
    DoubleJ_0-1715282845951.png

  2. In Power Query duplicate the LHAs column named e.g. "LHAs -Copy"
  3. Split the "LHAs -Copy"column into new columns (by comma) --> you will get several new columns depending on how many values are packed most in one LHA column. In my test file this creates 4 columns, let's call them LHA1-4.
    DoubleJ_1-1715282937172.png
  4. Create a new table by referencing the base table, let's call it "Filter Table"
  5. In the "Filter Table" only keep the unique ID column and LHA1-4
  6. Select the ID column and select "Unpivot other columns"
    DoubleJ_2-1715283007044.png

  7. Rename the "Value" Column to "LHA Filter" or something appropriate
  8. In Power BI Desktop in the "Model View" create a relationship between the 2 table using the ID columns. Make sure Cross Filter Direction is set to "Both"
    DoubleJ_3-1715283079607.png

     

    DoubleJ_4-1715283099495.png

     



  9. Now you can use the "LHA Filter" column of the Filter Table in your slicer to filter your base table

    DoubleJ_5-1715283179306.png

     

Please let me know if this was helpful.
Thanks.
JJ

 

View solution in original post

2 REPLIES 2
DoubleJ
Solution Supplier
Solution Supplier

Hi

Intersting task. I created I sample file but cannot find a way to upload it (wasn't this possible a while ago?). I hope my description and screenshots help.

Steps

  1. You need a unique identifier in your table. If you dont have one create it by adding an index column in Power Query.
    DoubleJ_0-1715282845951.png

  2. In Power Query duplicate the LHAs column named e.g. "LHAs -Copy"
  3. Split the "LHAs -Copy"column into new columns (by comma) --> you will get several new columns depending on how many values are packed most in one LHA column. In my test file this creates 4 columns, let's call them LHA1-4.
    DoubleJ_1-1715282937172.png
  4. Create a new table by referencing the base table, let's call it "Filter Table"
  5. In the "Filter Table" only keep the unique ID column and LHA1-4
  6. Select the ID column and select "Unpivot other columns"
    DoubleJ_2-1715283007044.png

  7. Rename the "Value" Column to "LHA Filter" or something appropriate
  8. In Power BI Desktop in the "Model View" create a relationship between the 2 table using the ID columns. Make sure Cross Filter Direction is set to "Both"
    DoubleJ_3-1715283079607.png

     

    DoubleJ_4-1715283099495.png

     



  9. Now you can use the "LHA Filter" column of the Filter Table in your slicer to filter your base table

    DoubleJ_5-1715283179306.png

     

Please let me know if this was helpful.
Thanks.
JJ

 

Hello DoubleJ,

 

Your solution worked. Thank you so much!! 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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