I have a Table where an ID can occur over multiple dates due to having different states.
| ID | State | DATE |
|---|---|---|
| A | a | 2022-01-01 |
| A | b | 2022-01-02 |
| A | c | 2022-01-03 |
| B | d | 2022-01-01 |
| B | e | 2022-01-02 |
| C | f | 2022-01-03 |
I would like to create ONE measure to distinct count the IDs.
This measure is needed for KPI cards, Line Charts and table visuals.
This is easily done with:
Count = DISTINCTCOUNT('Table'[ID])
Displaying this measure in a table visual split by Date.
| Date | Count |
|---|---|
| 2022-01-01 | 2 |
| 2022-01-02 | 2 |
| 2022-01-03 | 2 |
| Total | 3 |
A count will appear for each date where this ID occurred. The Total will always be correct.
However, I do not want to distinct count for each date. Just the first date at which the ID occurred.
| Date | Count |
|---|---|
| 2022-01-01 | 2 |
| 2022-01-02 | 0 |
| 2022-01-03 | 1 |
| Total | 3 |