Forum Discussion
COUNTIFS in Power Query
- Anonymous3 years ago
In case anyone is interested, this is what I tried and it worked:
#"Added Count of Ys" = Table.AddColumn(#"Added Payment Type", "Count of Ys", each List.Count (List.Select({34,35,36,37}, each _ = "Y")))
Where: 34,35,36 and 37 are the column numbers in Power Query.
I've noticed that the created column is actually named as "count" only and comes right after column 37 instead - which I'm happy with that but just so you bear in mind in case it looks like it works but you don't see the column towards the end of your data as expected.
Thanks,
Ana
pls try this
List.Count(
List.Select(
Record.FieldValues(_),
each _ = "Y")
)Hi Ahmedx,
Thanks for that. This is what I tried last week but it counts all "Y"s from my row - my data has more than those four columns so I need to specify which columns it needs to read from.
Thanks,
Ana