We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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,
Solved! Go to Solution.
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.
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.
Can you please help me ?
Don't hesitate if it's not clear!
Thanks
uppp
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 6 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 7 | |
| 7 | |
| 6 |