Forum Discussion
CarlosFF
5 years agoFrequent Visitor
List.Select using a list from column names. Count ocurrences in columns starting with string.
Hi Im trying to count Yes/No/NA occurrences in the columns that starts with a scpecific string. Doing in this way will permit use the same code in tables with different number of columns. If ...
- 5 years ago
Hi.
I have found this approach in
MyCols = List.Buffer(List.Select(Table.ColumnNames(#"Reordered Columns"), each Text.StartsWith(_, "GROUP_"))), GROUP_1_Yes = Table.AddColumn(#"Reordered Columns" , "GROUP_1_Yes", each List.Count(List.Select(Record.ToList(Record.SelectFields(_,MyCols)), each _ = "Yes")) ,Int64.Type),Thank you all for your help!
🙂
AlB
Community Champion
5 years agoYou can just paste it here as normal text. Use the copy table option in PQ an paste here.
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
CarlosFF
5 years agoFrequent Visitor
Nice feature. It pastes correctly but when saving gives an HTML error. I have tried copying from excel and power Bi. No way. Also doing the table manually. Weird.
Best regards