Forum Discussion

leahschneider's avatar
leahschneider
Helper III
4 years ago
Solved

Filter on Multiple Columns

I have a table with data like this: Id Col1 Col2 1 A B 2 A A 3 C A 4 B A 5 C C I need to make an AB filter that filters for everything that has A or B in both colum...
  • mahoneypat's avatar
    4 years ago

    Here is a measure expression that shows one way to do it. I hard coded in A and B, but you could get them dynamically with a disconnected table slicer with the desired values (and store the VALUES of that column used in slicer in another variable, to replace the hard-coded tables).

     

    Has AB in Both =
    VAR col1 =
        MIN( T1[Col1] IN { "A", "B" }
    VAR col2 =
        MIN( T1[Col2] IN { "A", "B" }
    RETURN
        IFcol1 && col2, )

     

    Pat