Forum Discussion
baadshah
3 years agoFrequent Visitor
Clients Running Total with Distinct Count
Hi I have a data set with client sales and i want to aggregate a running total of the distinct count of clients. So in sample data 2020 Q1 we started of with 1 client and everytime a new client jo...
- Anonymous3 years ago
Hi baadshah ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a measure.
Running Distinct Count = VAR CurrentPeriod = MAX('Sample Data'[Period]) RETURN CALCULATE( DISTINCTCOUNT('Sample Data'[Client Name]), FILTER( ALLSELECTED('Sample Data'), 'Sample Data'[Period] <= CurrentPeriod ) )(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
3 years agoNot applicable
Hi baadshah ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a measure.
Running Distinct Count =
VAR CurrentPeriod = MAX('Sample Data'[Period])
RETURN
CALCULATE(
DISTINCTCOUNT('Sample Data'[Client Name]),
FILTER(
ALLSELECTED('Sample Data'),
'Sample Data'[Period] <= CurrentPeriod
)
)
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.