Forum Discussion

YBavré's avatar
YBavré
Frequent Visitor
3 years ago
Solved

Distinctcount on two filter values

Hi, I wonder if someone could help me with this issue. I have the folowing table: Enterprise_Nbr LOB (Line_of_business) 1 A 2 B 3 B 1 B 4 C 5 B 2 B 1 C   I ...
  • tamerj1's avatar
    3 years ago

    Hi YBavré 

    please try

    X =
    COUNTROWS (
        FILTER (
            VALUES ( ENHANCED_CKI_CUSTOMER[Enterprise_Nbr] ),
            COUNTROWS (
                INTERSECT (
                    CALCULATETABLE ( VALUES ( ENHANCED_CKI_PRODUCTS[LOB] ) ),
                    { "A", "B" }
                )
            ) = 2
        )
    )