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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Identify blank columns

Hello everybody,

 

I'm working on a file source Excel, with multiple columns (from A to DD let's say)

And i would like to add an additionnal column which identify the rows that have, the columns from K to EM all blank, and return "SUPPRIMER". In case there is, even one column from K to EM that is not blank, return "GARDER"

 

In Excel, i would have used the formula : =SI(NBVAL(K3:EM3)=0;"SUPP";"GARDER")). for example.

 

But in Power Query, i couldn't find the solution..

Can you help me with that ? 

 

Thankfully,

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You can add a custom column like this:

 

= Table.AddColumn(#"Changed Type", "Custom", each
    if List.IsEmpty(List.RemoveItems(Record.FieldValues(_), {null, ""}))
    then "SUPP"
    else "GARDER"
)

 

In the above, Record.FieldValues(_) is the list of all values in the current table row.

 

If you only want a certain range of these values, then use e.g. List.Range(Record.FieldsValues(_), 9, 6) to get a list of 6 elements starting at index 9. You could also use something like List.PositionOf(Record.FieldNames(_), "ColK") to find the index of ColK.

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

You can add a custom column like this:

 

= Table.AddColumn(#"Changed Type", "Custom", each
    if List.IsEmpty(List.RemoveItems(Record.FieldValues(_), {null, ""}))
    then "SUPP"
    else "GARDER"
)

 

In the above, Record.FieldValues(_) is the list of all values in the current table row.

 

If you only want a certain range of these values, then use e.g. List.Range(Record.FieldsValues(_), 9, 6) to get a list of 6 elements starting at index 9. You could also use something like List.PositionOf(Record.FieldNames(_), "ColK") to find the index of ColK.

Anonymous
Not applicable

Can you please help me ?

Don't hesitate if it's not clear!

 

Thanks

Anonymous
Not applicable

uppp

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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