Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Unique Slicer values from several columns

I currently have a table where the "Title" column contains 1 or more Car Brands (eg. VW, AUDI, SKODA) together with plenty of other text.
I want to have a slicer that shows each car brand that I define, and filter tickets where the title contains that specific car brand (even if mutliple brands are within the "Title" column.


Currently I use the DAX functions to find specific strings in the "Title" column for each car brand, meaning I got around 5 columns with either a blank or the name of the car brand.
Then I made a slicer for each column where the blanks are filtered out.
Its not pretty and therefore I want to change it so I have 1 slicer only.

I would really appreciate if someone has a solution.

2 Replies

  • Anonymous , One way it unpivot the column in Power Query and get them in one column.

     

    Another way is to create a table in DAX

    Table = Distinct(Union(Distinct(Table[Col1]),Distinct(Table[Col2]),Distinct(Table[Col3]),Distinct(Table[Col4]),Distinct(Table[Col5]) ) )

     

    You can join it with all columns back and can use userelationship to create measures

     

    https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in-power-bi

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks! That DAX formula is exactly what I needed.

      I am however not too good with creating relationships, how would I go about writing those DAX expressions measures for text values?

      Also I can only create many to many relationships for some reason: