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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.