Forum Discussion
adavid999
4 years agoHelper V
filter max in M
Hello, is it possible to set up filter in M so table only shows max value in 'year' column? If so, please can you show code for this? I would like to filter my table to only show max value in 'year' ...
- 4 years ago
Try this , you need to streamline column names and previous step names
let Source = x_optional, #"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", Int64.Type}}), #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Year", "year"}}) #"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each ([year] = List.Max(#"Renamed Columns"[year]))) in #"Filtered Rows"
VijayP
4 years agoCommunity Champion
Try this , you need to streamline column names and previous step names
let
Source = x_optional,
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Year", "year"}})
#"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each ([year] = List.Max(#"Renamed Columns"[year])))
in
#"Filtered Rows"