Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Running Total for Count Distinct Measure

I am trying to count distinct values in a by date and create a new measure that calculates the cumulative sum of the distinct counts as the time period progresses: The table on the left is representa...
  • MattAllington's avatar
    5 years ago

    Assuming you have a calendar table

    https://exceleratorbi.com.au/power-pivot-calendar-tables/

    something like this

    Distinct products =DISTINCTCOUNT(data[product])

     

    Running total =CALCULATE(sumx(values(calendar[date]),[Distinct Products]),Filter(All(calendar),calendar[date] <= max(calendar[date])))

     

    use the calendar date column in your visual.