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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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,
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 81 | |
| 66 | |
| 50 | |
| 45 |