Forum Discussion
jcastr02
1 year agoPost Prodigy
Custom column based on whats contained in a row
I was trying to create a custom column in power query (a yes/no column is fine) that if any of the values in the row contains *00:00, the FE Yes/No column would be "No, if not then "Yes" see below...
- Anonymous1 year ago
Hi jcastr02 ,
Please try:
= Table.AddColumn(#"Changed Type", "Custom", each if List.ContainsAny({Record.Field(_, "FE Sat Open"), Record.Field(_, "FE Sat Close")}, {"*00:00"}) then "Yes" else "No")Best Regards,
Bof
- 1 year ago
Create a new step by clicking FX button and then paste that code in Editor, what you're doing is pasting the code in a custom column.
Anonymous
1 year agoNot applicable
Hi jcastr02 ,
I've made a test for yor reference:
if List.ContainsAny(Record.FieldValues(_), {"*00:00"}) then "Yes" else "No"
Best Regards,
Bof
- jcastr021 year agoPost Prodigy
Apologies, I should have clarified - what if I Only wanted to check within this table for specific columns, such as FE Sat Open and FE Sat Close (as example) - how could I tailor to list out the specific columns?
- Anonymous1 year agoNot applicable
Hi jcastr02 ,
Please try:
= Table.AddColumn(#"Changed Type", "Custom", each if List.ContainsAny({Record.Field(_, "FE Sat Open"), Record.Field(_, "FE Sat Close")}, {"*00:00"}) then "Yes" else "No")Best Regards,
Bof
- jcastr021 year agoPost Prodigy
Hello Anonymous Thanks so much. I tried to enter this , however getting different answers when the values are the same in the rows. Any ideas? Thanks so much.