Forum Discussion
Fryyy
8 years agoAdvocate II
multiple columns if value=1 write column name in separate column
Hello, i have a problem: ich have multiple columns like that: Station1 Station2 Station3 Station4 0 1 0 0 0 1...
- 8 years ago
Assuming you have also other columns, this would be a Power Query solution:
let Source = Table1, #"Added Custom" = Table.AddColumn( Source, "Stations", (ThisRow) => Text.Combine( List.Transform( List.Select( List.Zip( {Record.FieldNames(ThisRow), Record.FieldValues(ThisRow)}), each _{1} = 1 and Text.StartsWith(_{0},"Station")), each _{0}), ", ") ) in #"Added Custom"
Anonymous
4 years agoNot applicable
Hi I have a similar table - only I have a Customer ID column - how can I create the labels while maintaining which customer the rows are for?