Forum Discussion

chris886's avatar
chris886
Frequent Visitor
1 year ago
Solved

Distinct Count and Row Count Help

Here's my sample data   Row Number Name 1 Chris 1 Dave 1 Adam 2 Chris 2 Evan 3 Dave 3 Evan 3 George   Here are the results I'm looking for, I know that I ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi chris886 ,

    I create a table as you mentioned.

    Then I create a new table and I also use the DAX code as tackytechtom mentioned.

    Table 2 = SUMMARIZE ( 'Table', 'Table'[Name], "Events", COUNTROWS ( 'Table' ) )

    Measure = 
        IF(ISFILTERED('Table'), DISTINCTCOUNT('Table'[Row Number]), DISTINCTCOUNT('Table'[Name]) )

    Finally when you add a slicer, you will get what you want.

     

     

     

    Best Regards

    Yilong Zhou

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.