Forum Discussion

Marek12345's avatar
Marek12345
Frequent Visitor
2 years ago
Solved

Filter data that match all conditions in other table (multiple columns) - row by row

Hi,   hope you can help me with the following issue. I have one table with users and conditions which the users have:   Users Conditions User 1 C 1 User 1 C 2 User 1 C 3 User ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Marek12345 

     

    Do you mind creating a table visual like this?

    Or a matrix visual like this?

    To achieve above result, you need to transform the Criteria table into below format. Steps are:

    1. Select "Criteria" column and unpivot other columns. 

    2. Filter out empty values in "Value" column. 

     

    Then create the following measure

    Is Met ? = 
    VAR _criteriaFields = SUMMARIZE(Criteria,Criteria[Value])
    VAR _userFields = SUMMARIZE('Table','Table'[Conditions])
    RETURN
    IF(COUNTROWS(INTERSECT(_criteriaFields,_userFields))=COUNTROWS(_criteriaFields),1,0)

    As two tables are not connected to each other, you need to add this measure to the table or matrix, otherwise it will display an error saying "Can't determine relationships between fields."

     

    Hope this would be helpful. 

     

    Best Regards,
    Jing
    If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!