Dan Bliss
New member
- Joined
- Dec 7, 2016
- Messages
- 45
- Reaction score
- 0
- Points
- 0
- Excel Version(s)
- Office 365
Hello, Please help:
I want my M (Power Query) function to return a list of unique values taken from a particular column in a table. The red [ColumnName], part of a condition clause, does not work. Can anyone help me with the correct syntax/function to turn the text value in ColumnName to the correct Table column reference?
Thanks.
Dan
I want my M (Power Query) function to return a list of unique values taken from a particular column in a table. The red [ColumnName], part of a condition clause, does not work. Can anyone help me with the correct syntax/function to turn the text value in ColumnName to the correct Table column reference?
Thanks.
Dan
Code:
(aTable, ColumnName as text) =>let
resultList = Table.Column
(
Table.SelectRows
(
Table.Distinct
(
aTable,{ColumnName}
)
, each ([B][COLOR=#ff0000][ColumnName][/COLOR][/B] <> null)
), ColumnName
)
in
resultList