I have a data like the below (first 4 columns)
In PowerQuery M, I want to add a new column called 'Agent Count' with a count of the number of agents enabled per machine.
I have looked around this community. There is a solution to use groupby, which I don't want to use as I want to retain my original data.
Go to Solution.
simply add a column with this formula:
List.Count(List.Select(Record.FieldValues(_), (x) => Text.Contains(x, "enabled")))
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark my post as a solution. Thanks!
How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
View solution in original post
That was much simpler than I thought. Thank you @imkyu
Join us in the third Triple A event!
It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.
Make sure you didn't miss any of the things that happened in the community in January!