Forum Discussion

c_laurenti's avatar
c_laurenti
Frequent Visitor
2 years ago
Solved

Check if unique values of filtered column is among those in a list

Suppose I have a column X with values [A, B, C, C, A], and a slicer based off of X. What is the dax expression for a measure M such that M is true if, and only if, the unique values of X filtered are among {A, B}? It is kind of like a selected value, but for more than one value.

 

More generally, how should I check if the unique values of a filtered column are among those in a given (finite) list?

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  c_laurenti 
    barritown  nice method!And here's my solution.

    According to your describe, here are my test process

    To achieve your goal, you can follow these steps:

    Here are my test data

    1.Create a measure by using DAX

    ISALLAB = 
    VAR SELECTEDVALUES = VALUES('Table'[X])
    RETURN
        COUNTROWS(INTERSECT(SELECTEDVALUES,{"A","B"}))=COUNTROWS(SELECTEDVALUES)

    2.Create a card by using measure

    3.Final output
     

     

     

     

    In order for you to solve the problem faster, you can refer to the following documentation

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

     

    Best Regards,

    Albert He