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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Count blank cells across a range of column..

Hi There,

 

I am new to Power Query and stuck up with below, Below formula from excel counts number of blank cells from a cell range.

 

I am trying to replicate the same in power bi query editor. My plans are to create calculated fields and use the logic to get the number of blank cells present.

 

=COUNTIF(Y2:AE2,"")

 

Thanks in Advance 🙂

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

Hi @Anonymous ,

 

Please transpose the table in power query like that.

Capture.PNG

 

Close and apply and create a measure as below.

Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Column1] = BLANK()))

2.PNG

 

Pbix as attached.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

5 REPLIES 5
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please transpose the table in power query like that.

Capture.PNG

 

Close and apply and create a measure as below.

Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Column1] = BLANK()))

2.PNG

 

Pbix as attached.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
artemus
Employee
Employee

You can add a new column with a formula like:

 

List.Count(List.Select(Record.FieldValues([[Y], [Z], [AA], {AB], [AC], [AD], [AE]]), each _ = "" or _ = null))

 

 

Anonymous
Not applicable

@artemus Thanks a lot for your response...

 

Below is the further scenarion post using the formula.

 

The syntax for 'COUNT' IS INCORRECT.
(DAX(LIST.COUNT(List.Select(record.Fieldvalues(column1,col2.....,or _ = " ")

Further to this it says "List.Count/List.Select/Record.fieldvalues is not a function".

 

Kindly Advise!!

 

Regards..

Anonymous
Not applicable

@amitchandak any advise on this?

@Anonymous , the options that I can quickly think off.

Measure =
calculate(count(table[Column1]), isblank(table[Column1]))
+calculate(count(table[Column2]), isblank(table[Column2]))
+calculate(count(table[Column3]), isblank(table[Column3]))

OR
Measure =
var _1, union(all(table[Column1]),all(table[Column2]),all(table[Column3]))
return
countx(_1,[Column1])

s

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors