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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
OhMyDearLord
Frequent Visitor

Count number of nulls in a column across all columns

Hello All,

 

I'm working on a dataset with a lot of columns and I want to see for each column how many nulls there are. Also there are some columns that have things like "Unanswered" or "N/A" and I'd want these included in the count as well.

I don't want to have to type in all of the column names as there are over 100 columns to do this across.

 

Ideally the result would come out like a table like this, but if there's a more appropriate way I'm all ears.

A: 2

B: 4

C: 1

😧 3

 

Below is what the data looks likeOhMyDearLord_0-1681397257040.png

 

Many Thanks in Advance!

1 ACCEPTED SOLUTION
m_dekorte
Super User
Super User

Hi @OhMyDearLord,

 

You could do something like this

 

 

let
    n = {null, "Unanswered", "N/A"},
    Source = YourTableOrQueryReference,
    Result = Table.FromColumns( 
      {
        Table.ColumnNames( Source ), 
        List.Transform( Table.ToColumns( Source ), each List.Count( List.Select( _, (v) => List.Contains( n, v))) ) 
      }
    )
in
    Result

 

 

Where n contains the items you want to count accross all columns and Source is your table

It will return a table listing all columns in Column1 and the Count in Column2

 

m_dekorte_0-1681401392179.png

 

View solution in original post

2 REPLIES 2
OhMyDearLord
Frequent Visitor

Thanks @m_dekorte this works really well

m_dekorte
Super User
Super User

Hi @OhMyDearLord,

 

You could do something like this

 

 

let
    n = {null, "Unanswered", "N/A"},
    Source = YourTableOrQueryReference,
    Result = Table.FromColumns( 
      {
        Table.ColumnNames( Source ), 
        List.Transform( Table.ToColumns( Source ), each List.Count( List.Select( _, (v) => List.Contains( n, v))) ) 
      }
    )
in
    Result

 

 

Where n contains the items you want to count accross all columns and Source is your table

It will return a table listing all columns in Column1 and the Count in Column2

 

m_dekorte_0-1681401392179.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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