Forum Discussion

sa000's avatar
sa000
Frequent Visitor
2 years ago
Solved

How to filter on comma separated column

Hi.

 

Suppose I have sample data as this

ProductColor
Ared
Bred
Cblue
Dred,blue
Ered,blue
Fblue
Gblue

 

I would like the user to be able to filter by the color, red OR blue, not "red, blue". So if the user selects Red, A,B,D,E are filtered. Right now I'm not sure how to create a filter to do that. 


I see a similiar post which looks like it accomplishes what I want but is a bit hard to follow, https://community.fabric.microsoft.com/t5/Developer/Filter-on-comma-separated-multiselect-field/m-p/1631990#M27556

 

 

13 Replies

    • ParameswaranP's avatar
      ParameswaranP
      New Member

      Hi,

      Can you help me with a measure to count the No. of red and No. of blue?

      ProductColor
      Ared
      Bred
      Cblue
      Dred,blue
      Ered,blue
      Fblue
      Gblue



      In this case, the output expected is Red = 4, Blue = 5

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

        In Power Query, split the Color column into rows.  To your Table visual, drag Color to the row labels and write this measure

        Measure = countrows(Data)

        Hope this helps.

  • sa000's avatar
    sa000
    Frequent Visitor

    This is great! Can you outline your steps so I can reproduce in my usecase?

  • Hi,

    In the Query Editor, split the colour column by rows using the comma delimiter.  Click on Close and Apply.  Now create slicer/visuals.