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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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