Forum Discussion
Anonymous
1 year agoNot applicable
List.Average and Select rows
Hello, could someone help me with this problem? I am trying to add this formula =List.Average(Table.SelectRows(#"added custom6", each [roles] = _[roles])[wage]) I have this table ROLES WAG...
danextian
1 year agoSuper User
let
role = [ROLES]
in List.Average(Table.SelectRows(#"Changed Type",each [ROLES] = role)[WAGE])
I simply updated this part of your formula with the correct syntax:
each [roles] = _[roles]
[ROLES] is a column assigned to the role variable. This should be done whenver you're trying to access a column outside the current scope which in this case is #"Changed Type". Whatever the value of ROLES is it will be assigned to this variable and will be used to filter the previous step which result is carried over in the current step. By not doing this you are simply telling Power Query to return true for all rows.
Anonymous
1 year agoNot applicable
It works. Thank you very much. amitchandak thank you too for your effort.