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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Evaluate filter expression for all columns (count rows where any column is empty)

Hi, 

 

I'm trying to count all rows where at least one column/value is empty. 

My attempt: COUNTROWS(FILTER(tablename; (true when all values are NOT empty)))

Now my problem: How do I write this boolean expression without checking all columns?

Is there some way to iterate over all columns without having to hard-code them?

 

Thanks, 

Ruben

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Suppose the table is like below:

Capture.PNG 

 

Click query editor-> transform-> click on columns [Value1], [Value2] and [Value3]-> Unpivot, then the table will be transformed like below:

1.PNG 

 

After apply&close, create a calculate column using dax below:

Flag = IF(CALCULATE(COUNT('Table'[Key]), ALLEXCEPT('Table', 'Table'[Key])) = 3, 1, 0)

2.PNG

 

Then create a measure to achieve the rows number:

Result = SUM('Table'[Flag]) / 3

3.PNG 

 

Community Support Team _ Jimmy Tao

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

View solution in original post

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Suppose the table is like below:

Capture.PNG 

 

Click query editor-> transform-> click on columns [Value1], [Value2] and [Value3]-> Unpivot, then the table will be transformed like below:

1.PNG 

 

After apply&close, create a calculate column using dax below:

Flag = IF(CALCULATE(COUNT('Table'[Key]), ALLEXCEPT('Table', 'Table'[Key])) = 3, 1, 0)

2.PNG

 

Then create a measure to achieve the rows number:

Result = SUM('Table'[Flag]) / 3

3.PNG 

 

Community Support Team _ Jimmy Tao

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

kentyler
Solution Sage
Solution Sage

Are you asking this because the number of columns varies ? or are you just looking for a short cut in writing the code ?





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Anonymous
Not applicable

@kentyler 

the number and names of the columns may vary, yes.

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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