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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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