Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ACraig08
Helper III
Helper III

Distinct Count is not showing the distinct number of items in the column

I created a measure to show the count of distinct SP Numbers in my tables column and it isn't working correctly. The column has multiple lines with the same SP.

ACraig08_0-1706208602358.png

It says there are 280 distinct values but there should be 771. Can anyone tell me why this is happening?! 

3 REPLIES 3
Anonymous
Not applicable

Hi @ACraig08 

 

Can you provide detailed sample data? How to provide sample data in the Power BI Forum - Microsoft Fabric Community . So that we can better understand the problem and help you. Or show it as a screenshot or excel. Please remove any sensitive data in advance.

 

Best Regards,
Community Support Team _Yuliax

amustafa
Solution Sage
Solution Sage

Hi @ACraig08 It's best to clean your text column in Power query to remove any leading/trailing spaces. (Right nouse click on column, select Transform -> Trim, Clean, etc). See if that helps.

 

There's a difference between count rows disctict counts. You can try COUNTROWS() instead

 

If I answered your question, please mark this thread as accepted and Thums Up!
Follow me on LinkedIn:
https://www.linkedin.com/in/mustafa-ali-70133451/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




speedramps
Super User
Super User

You say "The column has multiple lines with the same SP"

The DISTINCTCOUNT only counts distinct values

 

For example is you have values  A,B,A,C,A,D then there are only 4 distinct values ABCD.

 

Also Power Bi is case insenstive,  

For example values A,a,B,b will onl hace 2 distinct values

 

Learn more here

https://learn.microsoft.com/en-us/dax/distinctcount-function-dax

 

Thanks for the clear description of the problem. I wish everyone did that!

Remember we are unpaid volunteers, and you have got free expert help which took a lot of effort,
This solution works and does exactly what you asked.
So please quickly click the [accept as solution] and the thumbs up button to leave kudos. 

One question per ticket please. If you need to change or extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

If you quote @speedramps in your next tickets then I will then receive an automatic notification, and will be delighted to help you again.

Please now click the [accept as solution] and the thumbs up button.  Thank you.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.