Forum Discussion
Learner1585
Helper I
2 years agoundefinedCrew another custom column to count how many times each row value occurs in power query
Hi, I want to create a custom column to count how many times a specic row value occurs in a column. I dont want to create a calculated column but a custom colum as a transformation step in power...
- 2 years ago
Hi,
Thank you very much for your kind reply.Pardon me for my follow up, but being not so pro , can I seek your help again on how to add your codes into my existing codes.
Should I just add your code after my last step "
#"Added Index" = Table.AddIndexColumn(#"Merged Columns1", "Index", 1, 1, Int64.Type)
- PreviousStepName = <Your existing code here>,
BufferedList = List.Buffer(PreviousStepName[4sector UID]),
AddColumn = Table.AddColumn(PreviousStepName, "Count", each List.Count(List.Select(BufferedList, (l)=> l=[4sector UID])))
Thanks again
- PreviousStepName = <Your existing code here>,
ImkeF
Community Champion
2 years agoYes, exactly.
So the end of your code would look like so:
#"Added Index" = Table.AddIndexColumn(#"Merged Columns1", "Index", 1, 1, Int64.Type),
BufferedList = List.Buffer( #"Added Index" [4sector UID]),
AddColumn = Table.AddColumn( #"Added Index" , "Count", each List.Count(List.Select(BufferedList, (l)=> l=[4sector UID])))
in
AddColumn
Learner1585
Helper I
2 years agothank you ImkeF