Forum Discussion
Help with DistinctCount by Date
- Anonymous4 years ago
Hi adoster
Try to create this measure to achieve your goal.
Measure = VAR _SUMMARIZE = SUMMARIZE('Table','Table'[Date],"DISTINCT COUNT",DISTINCTCOUNT('Table'[Name])) RETURN SUMX(FILTER(_SUMMARIZE,[Date]<= MAX('Table'[Date])),[DISTINCT COUNT])Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi adoster
Try to create this measure to achieve your goal.
Measure =
VAR _SUMMARIZE = SUMMARIZE('Table','Table'[Date],"DISTINCT COUNT",DISTINCTCOUNT('Table'[Name]))
RETURN
SUMX(FILTER(_SUMMARIZE,[Date]<= MAX('Table'[Date])),[DISTINCT COUNT])
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi RicoZhou,
I ran across one snag on the solution I was wondering if you might be able to help.
The Table View shows the correct total count (5) that I was looking for, but it doesn't work on a Graph Visualization. It still shows the total procedure count (8)
To try and solve this I added a column which gives a Rank to each Procedure Name. My thought is that the Graph would only count the highest rank and then ignore everything after.
Sorry if this is a totally separate issue and I can create a new post if needed 🙂
Example of volume that would show on a graph:
| Date | Name | Procedure Display Name | Distinct PDN | Rank |
| 11/8/2021 | Donald Duck | Procedure A | 1 | 1 |
| 11/8/2021 | Donald Duck | Procedure B | 1 | 2 |
| 11/8/2021 | Mickey Mouse | Procedure A | 1 | 1 |
| 11/8/2021 | Mickey Mouse | Procedure B | 1 | 2 |
| 11/9/2021 | Donald Duck | Procedure A | 1 | 1 |
| 11/9/2021 | Donald Duck | Procedure B | 1 | 2 |
| 11/9/2021 | Mickey Mouse | Procedure A | 1 | 1 |
| 11/10/2021 | Mickey Mouse | Procedure B | 1 | 1 |
| Desired Results | ||
| Procedure Display Name | Count by Rank | |
| 11/8/2021 | Procedure A | 2 |
| 11/8/2021 | Procedure B | 0 |
| 11/9/2021 | Procedure A | 2 |
| 11/9/2021 | Procedure B | 0 |
| 11/10/2021 | Procedure A | 0 |
| 11/10/2021 | Procedure B | 1 |
| Total | 5 |
Thanks for any assistance.