Forum Discussion
Anonymous
6 years agoNot applicable
DAX Distinct Count with Filter
I'm comparing 2 columns; [Ticket Number] and [Scan datetime] in the same table. I need to find the total number of unique tickets with a scan. I came up with the following formula but not sure if it...
- 6 years agoAnonymous - I do not see anything wrong with that calculation. It is probably not how I would have structured it but because I try to avoid using CALCULATE but there is nothing wrong with it if your intention is to get a distinct count of only the TICKET's that have a SCAN_DATETIME.
Anonymous
6 years agoNot applicable
Greg_Deckler my apologies. Here is sample dataset.
Output result: What is the count of (unique) tickets that have a scan date? My current formula is:
Total_Tickets_With_Scan:=CALCULATE(DISTINCTCOUNT(Table_Name[TICKET]),Table_Name[SCAN_DATETIME]<>BLANK())
Hope that made sense.
| TICKET | SCAN_DATETIME |
| FF166549317 | 28/04/2020 12:52 |
| FF166549626 | |
| FF166549820 | |
| FF166550071 | |
| FF166550329 | 28/04/2020 12:51 |
| FF166550394 | |
| FF166550403 | |
| FF166550448 | 28/04/2020 16:53 |
| FF166551125 | 28/04/2020 17:53 |
| FF166551545 |
Greg_Deckler
Community Champion
6 years agoAnonymous - I do not see anything wrong with that calculation. It is probably not how I would have structured it but because I try to avoid using CALCULATE but there is nothing wrong with it if your intention is to get a distinct count of only the TICKET's that have a SCAN_DATETIME.
- Anonymous6 years agoNot applicable
Greg_Deckler thank you for confirming. Appreciate your help.