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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Viswa1127
Frequent Visitor

Count values in a column

Hi All,

I am trying to count the values in one column in my table but it is counting blank values also. How to neglect blank values. Any ideas?

Viswa1127_0-1651654703875.pngViswa1127_1-1651654740062.png

When i apply count it is counting blank values also. Thanks in advance!

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Viswa1127 ,

 

Try using either of these:

_option1 = DISTINCTCOUNTNOBLANK(yourTable[yourColumn])

_option2 = COUNT(yourTable[yourColumn]) - COUNTBLANK(yourTable[yourColumn])

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
BA_Pete
Super User
Super User

Hi @Viswa1127 ,

 

Try using either of these:

_option1 = DISTINCTCOUNTNOBLANK(yourTable[yourColumn])

_option2 = COUNT(yourTable[yourColumn]) - COUNTBLANK(yourTable[yourColumn])

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




@BA_Pete ,
Thanks alot first one I have tried. I am not aware of countblank() function it is solving my problem.

Viswa1127
Frequent Visitor

Hi, How it is help in my current scenario? I just want the count of values in column whithout including the blanks!

 

Burningsuit
Resident Rockstar
Resident Rockstar

Hi @Viswa1127 

You need to understand how the DAX language works with blanks and Zeros, luckily, we've written a blog on exactly that subject.

This should answer your questions.

How DAX Treats Nulls & Zeros | Power BI Guide | Burningsuit

hope this helps

Stuart 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.