Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Greetings,
I have a table of data about tests. Individual ID's can take more than one test in a given day. I'm trying to compute a column that calculates the number of distinct dates in the table per ID. So for example:
ID | Subject | Date |
1 | Math | 1/1/2022 |
2 | Science | 2/2/2022 |
2 | Math | 2/2/2022 |
3 | English | 3/1/2022 |
3 | Math | 3/1/2022 |
3 | Math | 4/1/2022 |
With my expect result being:
ID | Subject | Date |
| Unique Dates by ID |
1 | Math | 1/1/2022 |
| 1 |
2 | Science | 2/2/2022 |
| 1 |
2 | Math | 2/2/2022 |
| 1 |
3 | English | 3/1/2022 |
| 2 |
3 | Math | 3/1/2022 |
| 2 |
3 | Math | 4/1/2022 |
| 2 |
I've tried various combinations using calculate, summarize, and sumx. And I can get the value I expect in a visual by using distinct count, but I can't get it to work with DAX.
Thanks!
Solved! Go to Solution.
Your Calculated Column is:
UniqueDatesbyID = CALCULATE( DISTINCTCOUNT( [Date] ),
ALLEXCEPT( Tests, Tests[ID] ))
Trust this is what you are looking for.
Regards,
Your Calculated Column is:
UniqueDatesbyID = CALCULATE( DISTINCTCOUNT( [Date] ),
ALLEXCEPT( Tests, Tests[ID] ))
Trust this is what you are looking for.
Regards,
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.