Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

DAX - Calculate Column By Distinct Counts

Using DAX, how can I add an additional calculated column field that will return the distinct counts of deviceTxnId's for each deviceID?

 

  • count =
    CALCULATE (
        DISTINCTCOUNT ( 'table'[deviceTxnID] );
        ALLEXCEPT ( 'table'; 'table'[deviceID] )
    )

    Create a measure...

3 Replies

  • rocky09's avatar
    rocky09
    Solution Sage

    Anonymous

    you can simply use this measure

    distinctcounttx = DISTINCTCOUNT(Table1[deviceTxnID])

    Actually, I didn't get what results you are looking for?

    • Anonymous's avatar
      Anonymous
      Not applicable

      rocky09

       

      Thanks for helping me. To provide more detail on my desired output result: Below is a screen shot. 

       

      • Yggdrasill's avatar
        Yggdrasill
        Responsive Resident
        count =
        CALCULATE (
            DISTINCTCOUNT ( 'table'[deviceTxnID] );
            ALLEXCEPT ( 'table'; 'table'[deviceID] )
        )

        Create a measure...