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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hey guys,
I'm struggling to find a DAX based solution to this problem I'm having, this is the table I have:
How would I count the number of distinct values within column 2, grouping within the ID in the first column?
The count should look something like this:
Thanks for the help!
George
Solved! Go to Solution.
Hi @Mansfig2 ,
You can create a calculated column as below:
CountDistinct =
CALCULATE (
DISTINCTCOUNT ( 'Table'[ID2] ),
FILTER ( 'Table', 'Table'[ID1] = EARLIER ( 'Table'[ID1] ) )
)
Best Regards
Hi @Mansfig2 ,
You can create a calculated column as below:
CountDistinct =
CALCULATE (
DISTINCTCOUNT ( 'Table'[ID2] ),
FILTER ( 'Table', 'Table'[ID1] = EARLIER ( 'Table'[ID1] ) )
)
Best Regards
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 10 | |
| 10 | |
| 4 | |
| 3 | |
| 3 |