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

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

Reply
PJHos
Advocate I
Advocate I

count blank cells in a row including null

I am trying to count all cells in a row that contain now data

 

I got the below code from another post looking for something similar and it works counting blanks but not null values, is there a way to count the null values also

 

= Table.AddColumn(#"Filtered Rows", "Count Blanks", each List.Count(List.Range(List.Select(Record.FieldValues(_), each _ = ""), 1, 100)))

2 ACCEPTED SOLUTIONS
LQuedas
Resolver II
Resolver II

Hey @PJHos 

 

you can try the formula:

 

List.Count(List.Select(Record.FieldValues(_), each _ = "" or _ = null))

 

 

LQuedas_1-1674649045112.png

 

Hope it works for you...

 

Cheers, LQ

 

 

View solution in original post

Anonymous
Not applicable

List.Count(Record.FieldValues(_) , each _ <> null)

Try this? 🙂 

View solution in original post

5 REPLIES 5
PJHos
Advocate I
Advocate I

thank you both

 

@LQuedas worked exactly as intended

 

thank you so much 👍

LQuedas
Resolver II
Resolver II

Hey @PJHos 

 

you can try the formula:

 

List.Count(List.Select(Record.FieldValues(_), each _ = "" or _ = null))

 

 

LQuedas_1-1674649045112.png

 

Hope it works for you...

 

Cheers, LQ

 

 

LQuedas
Resolver II
Resolver II

Hey @PJHos 

 

the following formula gives you what you want, try it and let me know 😉

 

List.Count(Record.FieldValues(_))-List.NonNullCount(Record.FieldValues(_))

LQuedas_0-1674586662392.png

 

Cheers, LQ

Hi Thank you for taking the time to help 😊

 

I tried the code and this does indeed count all null cells however it now no longer counts the blanks as well

 

would it be possible to count both null and blanks for a row?

Anonymous
Not applicable

List.Count(Record.FieldValues(_) , each _ <> null)

Try this? 🙂 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors