Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 joined it increase the count for each period in the new viz. I've seen few examples on DAX forum but couldnt get it to work for my case. Thanks
Sample Data:
Period | Client Name |
2020 Q1 | Client 1 |
2020 Q1 | Client 1 |
2020 Q2 | Client 2 |
2020 Q3 | Client 3 |
2020 Q4 | Client 4 |
2021 Q1 | Client 5 |
2021 Q1 | Client 5 |
End Result:
Period | Running Distinct Count |
2020 Q1 | 1 |
2020 Q2 | 2 |
2020 Q3 | 3 |
2020 Q4 | 4 |
2021 Q1 | 5 |
Solved! Go to Solution.
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.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
46 | |
28 | |
23 | |
12 | |
8 |
User | Count |
---|---|
76 | |
51 | |
45 | |
16 | |
12 |