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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Sajay_Prathap24
New Member

DAX Query for Count of Blank Cells

Dears....I have a excel database and ther are some cells not filled. From Power BI, I need to know the count of those blank cells based on which column the blank cells is available. Please advise for the DAX query for this

 

For Eg: Column A = 4, Column D = 6

4 ACCEPTED SOLUTIONS
tharunkumarRTK
Super User
Super User

@Sajay_Prathap24 

there are several ways to do this, I would suggest you to use the column statistics in DAX query view. It gives all the statistics in view. 
https://learn.microsoft.com/en-us/power-bi/transform-model/dax-query-view
Open DAX query view, on the right hand side you will find all the tables in your model. 

Right click on the table, click on Qucik queries -> click on Show column statistics. 

In the result tab, you will see a column caled Null count. 

 

You can also find blank or empty values from power query column profiling options. 'Column quality'

https://learn.microsoft.com/en-us/power-query/data-profiling-tools

However by default it will only profile top 1000 rows and the results would show in percentage. 

 

 

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

View solution in original post

rohit1991
Super User
Super User

Option 1: Count Blank Cells for Each Column


Count_Blanks_ColumnA = COUNTROWS(FILTER(YourTable, ISBLANK(YourTable[ColumnA])))

Count_Blanks_ColumnD = COUNTROWS(FILTER(YourTable, ISBLANK(YourTable[ColumnD])))

Replace YourTable, ColumnA, and ColumnD with your actual table and column names.

Option 2: Count Blanks Dynamically for All Columns

Unpivot the columns in Power Query: Select your columns and use Unpivot Columns. Add a custom column: IsBlank = IF(ISBLANK([Value]), 1, 0). Group by the column name and sum IsBlank.

 

Option 3: Dynamic Measure for All Columns. To calculate blanks across all columns: |
Count_Blanks_All =

SUMX(ADDCOLUMNS(
VALUES(YourTable[ColumnName]),"BlankCount", COUNTROWS(FILTER(YourTable, ISBLANK(YourTable[ColumnName])))),[BlankCount])

Use in a table/matrix visual for column-wise blank counts.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

Idrissshatila
Super User
Super User

Hello @Sajay_Prathap24 ,

 

the way it will work for you is to do it per column

BlankCount_ColumnA = 
calculate(
COUNTROWS(Table), table[columnName] = blank)


Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




View solution in original post

Kedar_Pande
Super User
Super User

@Sajay_Prathap24 

You can try:

CountBlanks_ColumnA = COUNTROWS(FILTER('Table', ISBLANK('Table'[ColumnA])))
CountBlanks_ColumnD = COUNTROWS(FILTER('Table', ISBLANK('Table'[ColumnD])))

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Sajay_Prathap24 ,

 

Thanks for reaching out.

I reviewed this case and I think everyone's insights and workarounds are great.

Do you have any solutions provided by other users to solve the problem? Or you solved it by your own workaround, you are also welcome to share it.

If you still have doubts, please provide a more detailed description, preferably some virtual sample data, and the expected results.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Kedar_Pande
Super User
Super User

@Sajay_Prathap24 

You can try:

CountBlanks_ColumnA = COUNTROWS(FILTER('Table', ISBLANK('Table'[ColumnA])))
CountBlanks_ColumnD = COUNTROWS(FILTER('Table', ISBLANK('Table'[ColumnD])))

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Idrissshatila
Super User
Super User

Hello @Sajay_Prathap24 ,

 

the way it will work for you is to do it per column

BlankCount_ColumnA = 
calculate(
COUNTROWS(Table), table[columnName] = blank)


Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




rohit1991
Super User
Super User

Option 1: Count Blank Cells for Each Column


Count_Blanks_ColumnA = COUNTROWS(FILTER(YourTable, ISBLANK(YourTable[ColumnA])))

Count_Blanks_ColumnD = COUNTROWS(FILTER(YourTable, ISBLANK(YourTable[ColumnD])))

Replace YourTable, ColumnA, and ColumnD with your actual table and column names.

Option 2: Count Blanks Dynamically for All Columns

Unpivot the columns in Power Query: Select your columns and use Unpivot Columns. Add a custom column: IsBlank = IF(ISBLANK([Value]), 1, 0). Group by the column name and sum IsBlank.

 

Option 3: Dynamic Measure for All Columns. To calculate blanks across all columns: |
Count_Blanks_All =

SUMX(ADDCOLUMNS(
VALUES(YourTable[ColumnName]),"BlankCount", COUNTROWS(FILTER(YourTable, ISBLANK(YourTable[ColumnName])))),[BlankCount])

Use in a table/matrix visual for column-wise blank counts.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
tharunkumarRTK
Super User
Super User

@Sajay_Prathap24 

there are several ways to do this, I would suggest you to use the column statistics in DAX query view. It gives all the statistics in view. 
https://learn.microsoft.com/en-us/power-bi/transform-model/dax-query-view
Open DAX query view, on the right hand side you will find all the tables in your model. 

Right click on the table, click on Qucik queries -> click on Show column statistics. 

In the result tab, you will see a column caled Null count. 

 

You can also find blank or empty values from power query column profiling options. 'Column quality'

https://learn.microsoft.com/en-us/power-query/data-profiling-tools

However by default it will only profile top 1000 rows and the results would show in percentage. 

 

 

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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