Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
I want to count the number of unique values in a column (excluding duplicates and values of duplicates). Here is a sample 1-column table:
| ID |
A |
| A |
| A |
| B |
| C |
| D |
| D |
| E |
My ideal output is 3 (it includes 'B', 'C', 'E'). 'A' and 'D' are ignored since they have duplicates in the column.
Solved! Go to Solution.
@Anonymous Yeah, I missed a FILTER:
Measure =
VAR __Table = ADDCOLUMNS('Table',"__Count",COUNTROWS(FILTER('Table',[ID] = EARLIER([ID])))
RETURN
COUNTROWS(FILTER(__Table, [__Count] = 1))
@Anonymous Try:
Measure =
VAR __Table = ADDCOLUMNS('Table',"__Count",COUNTROWS('Table',[ID] = EARLIER([ID]))
RETURN
COUNTROWS(FILTER(__Table, [__Count] = 1))
Thanks for the suggestion. I am receiving an error that too many arguments were passed to the COUNTROWS function. Is there a way to work around this?
@Anonymous Yeah, I missed a FILTER:
Measure =
VAR __Table = ADDCOLUMNS('Table',"__Count",COUNTROWS(FILTER('Table',[ID] = EARLIER([ID])))
RETURN
COUNTROWS(FILTER(__Table, [__Count] = 1))
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.