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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Matrix counting blank values in table

Hi! 

I'd like to count all blank values in all columns in a data table and show them in a matrix, rows being the column names and one column showing the number of blanks in each column. 

 

Is there a way of writing a measure that handles counting blanks without specifying the column in the DAX-formula (doing this requires creating a measure for every column). 

 

This is an example: 

 

Data table: 

Name 1Name 2Name 3Name 4 Name 5
12 1 
11 22
 2 3 

 

Displayed like this: 

Name of columnNumber of blanks in table (measure)
Name 11
Name 20
Name 33
Name 40
Name 52

 

Can this be done? 

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You can try the Power Query as in the video below.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

4 REPLIES 4
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You can try the Power Query as in the video below.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Anonymous
Not applicable

Absolutely brilliant! 

Worked like a charm and very elegant. This worked with Direct Query as well 

 

Thanks so much!

parry2k
Super User
Super User

@Anonymous best approach would be to unpivot your table and then one measure can take care of this. To unpivot, go to Transform Data

 

add index column

select index column

right click, select unpivot other columns

 

you will have two new columns, Attribute and Value

 

and you can use COUNTBLANK() DAX to count blanks and on table visual add Attribute column and Measure and you will get the result.

 

Would appreciate Kudos 🙂 if my solution helped.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Thank you for the solution. 

Looks like this could work for projects using "Import", but I'm having difficulties as I'm using Direct Query (forgot to mention in my post).

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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