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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Count number of non blank cells in columns

Hello everyone,

 

I have 3 columns and I need to count the number of non blank cells in them.

I've tried to add a custom column and use the 'Count' Function but the results aren't correct.

Is there anyone who's having the same issue?

 

Thanks

1 ACCEPTED SOLUTION

If you want per column could create the next measure:

 

NBCol1 = COUNTROWS('BLANK')-COUNTBLANK('BLANK'[COL1])

 

If you want total:

NBTotal = (COUNTROWS('BLANK')-COUNTBLANK('BLANK'[COL1]))+(COUNTROWS('BLANK')-COUNTBLANK('BLANK'[COL2]))+(COUNTROWS('BLANK')-COUNTBLANK('BLANK'[COL3]))

Best Regards,
Miguel

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
ZunzunUOC
Resolver III
Resolver III

Hi @Anonymous , do you want total of the 3 columns or per column?

If you want per column could create the next measure:

 

NBCol1 = COUNTROWS('BLANK')-COUNTBLANK('BLANK'[COL1])

 

If you want total:

NBTotal = (COUNTROWS('BLANK')-COUNTBLANK('BLANK'[COL1]))+(COUNTROWS('BLANK')-COUNTBLANK('BLANK'[COL2]))+(COUNTROWS('BLANK')-COUNTBLANK('BLANK'[COL3]))

Best Regards,
Miguel

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

efet.PNG

Anonymous
Not applicable

No, it doesn't work.

It gives me the sum of all the cells:

Col 1 Col 2 Col 3  RESULT     Correct Results 

A                  C        5                       2

B       D         E        5                       3

 

Sorry, it works:

 

reply004.png

reply006.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.