Forum Discussion

giuliapiazza94's avatar
5 years ago
Solved

Count distinct values

Hi guys, This is my problem   I want to count how many name for each sales: for example, A has got 2 name and I need to create a new column with the number 2 (like in the picture). No measur...
  • PaulOlding's avatar
    5 years ago

    Here's some DAX to get your results.

     

    count(sales/name) =
    CALCULATE(
    DISTINCTCOUNT('Table'[name]),
    ALLEXCEPT('Table', 'Table'[Sales])
    )