Forum Discussion

et123's avatar
et123
New Member
1 year ago
Solved

Totalling a distinct count measure

User Count = DISTINCTCOUNT('View Data'[DisplayName])
 
If I am using his meansure in a matrix I need the total to be a total of the distinct counts.  I had seen a suggesion to use HASONEFILTER but not sure how to apply it to this measure to make it work correctly.
  • Hi et123 

     

    try something like this:

    User Count = 
    SUMX( 
       VALUES( 'View Data'[DisplayName] ), 
       DISTINCTCOUNT( 'View Data'[DisplayName] )
    )
  • et123 - If I interpret your requirement correctly you need every row to show the same total, e.g. each row will show the total of the DISTINCTCOUNT('View Data'[DisplayName]), in which case this should work:

     

    CALCULATE
       DISTINCTCOUNT( 'View Data'[DisplayName] ),
       REMOVEFILTERS( 'View Data' )
    )

     

    If this works, please accept as the solution, it helps with visibility for others with the same challenge, if it does not, please provide more information about what you are trying to acheive, and some sample data. 

4 Replies

  • timalbers's avatar
    timalbers
    Icon for Skilled Sharer rankSkilled Sharer

    Hi et123 

     

    try something like this:

    User Count = 
    SUMX( 
       VALUES( 'View Data'[DisplayName] ), 
       DISTINCTCOUNT( 'View Data'[DisplayName] )
    )
  • et123 - If I interpret your requirement correctly you need every row to show the same total, e.g. each row will show the total of the DISTINCTCOUNT('View Data'[DisplayName]), in which case this should work:

     

    CALCULATE
       DISTINCTCOUNT( 'View Data'[DisplayName] ),
       REMOVEFILTERS( 'View Data' )
    )

     

    If this works, please accept as the solution, it helps with visibility for others with the same challenge, if it does not, please provide more information about what you are trying to acheive, and some sample data. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi et123 ,

    similar situation

     

    Measure = 
    DISTINCTCOUNT('Table'[Column])
    Measure 2 = 
    VAR _table = SUMMARIZE('Table',[Type],"Result",[Measure])
    RETURN
    SUMX(_table,[Result])

     

     

     

    Best Regards

  • et123  - did we resolve your issue? If we did, please select the appropriate solution, it helps with visibility for others and for SuperUsers to keep their status! Thanks!