Forum Discussion
Help with DistinctCount by Date
Trying to find the distinct count of procedures by date.
| Date | Name | Procedure Display Name | Distinct PDN |
| 11/8/2021 | Mickey Mouse | Procedure A | 1 |
| 11/8/2021 | Mickey Mouse | Procedure B | 1 |
| 11/9/2021 | Mickey Mouse | Procedure A | 1 |
| 11/9/2021 | Mickey Mouse | Procedure B | 1 |
Desired Result:
| Date | Distinct Count of PDN |
| 11/8/2021 | 1 |
| 11/9/2021 | 1 |
| Total | 2 |
I tried a simple measure doing a discount count on the NAME which returns a value of 1
Desired Results with Multiple People across 3 days
| Date | Name | Procedure Display Name | Distinct PDN |
| 11/8/2021 | Donald Duck | Procedure A | 1 |
| 11/8/2021 | Donald Duck | Procedure B | 1 |
| 11/8/2021 | Mickey Mouse | Procedure A | 1 |
| 11/8/2021 | Mickey Mouse | Procedure B | 1 |
| 11/9/2021 | Donald Duck | Procedure A | 1 |
| 11/9/2021 | Donald Duck | Procedure B | 1 |
| 11/9/2021 | Mickey Mouse | Procedure A | 1 |
| 11/10/2021 | Mickey Mouse | Procedure A | 1 |
| TOTAL | 5 |
- 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.
5 Replies
- lbendlinSuper User
You need to decide what you are actually trying to measure. Distint count of name, distinct count of procedure, or distinct count of [Name]+[Procedure] ?
- adosterResolver I
I believe that I need distinct count based on Name & Procedure.
If one Name has 5 procedures on 1 day = 1 volume
If two Names each have 5 procedures on 1 day = 2 volume
If two Names each have 5 procedures on 2 days = 4 volume
If three Names each have 5 procedures on 2 days = 6 volume
In the first example above I did a Distinct Count on Name. The Total count give me 1 instead of the desired 2
Hope this helps
- AnonymousNot applicable
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.
- adosterResolver I
This worked! Thank you so much!