Forum Discussion

Dhrutivyasa-070's avatar
3 years ago
Solved

DAX

Hello Community,

I have two column in data set which is in below.
I create one slicer with Taster name. with multiple selection. Suppose i select as and ks.
i want distinct count of uniqueID which both taster.

i want 2 answer. one id is 100 and 102

Unique IDTaster
100as
100ks
100ds
101as
101ds
102as
102ks
102ds
102as

 

  • tamerj1's avatar
    tamerj1
    3 years ago

    Dhrutivyasa-070 
    Apologies for the late response and for misunderstanding the requirement. Please refer to attached sample file file with the proposed solution.

    Count = 
    SUMX ( 
        VALUES ( 'Table'[Unique ID] ),
        INT (
            ISEMPTY ( 
                EXCEPT ( 
                    VALUES ( 'Table'[Taster] ),
                    CALCULATETABLE ( VALUES ( 'Table'[Taster] ) )                
                )
            )
        )
    )

4 Replies

    • Dhrutivyasa-070's avatar
      Dhrutivyasa-070
      Helper I

      I try same this bus i get anwser is 3.

      i want only this unique id which contains both as and ks

      • tamerj1's avatar
        tamerj1
        Community Champion

        Dhrutivyasa-070 
        Apologies for the late response and for misunderstanding the requirement. Please refer to attached sample file file with the proposed solution.

        Count = 
        SUMX ( 
            VALUES ( 'Table'[Unique ID] ),
            INT (
                ISEMPTY ( 
                    EXCEPT ( 
                        VALUES ( 'Table'[Taster] ),
                        CALCULATETABLE ( VALUES ( 'Table'[Taster] ) )                
                    )
                )
            )
        )