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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors