Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Slice Table by Data in Multiple Columns

Hi everyone.  I was looking through similar posts but could not find a question seemingly the same.   I have a source table with rows defined for each "task" and then 3 columns indicating the perso...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

    Please try this way.
    I add a new table to create the slicer:

    There is no relationship between two tables:


    Use this DAX to create a measure:

    Measure = 
    VAR _P = ALLSELECTED('Slicer'[Name])
    RETURN
    IF(
        ISFILTERED('Slicer'[Name]),
        IF(
            COUNTROWS(
                FILTER(
                    _P,
                    [Name] IN VALUES('Table'[Position 1]) ||
                    [Name] IN VALUES('Table'[Position 2]) ||
                    [Name] IN VALUES('Table'[Position 3])
                )
            ) > 0,
            1,
            0
        ),
        1
    )

    Set the settings according to the following screenshot:

    The final output is as below:

    Best Regards,
    Dino Tao
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.