Forum Discussion

gvg's avatar
gvg
Icon for Post Prodigy rankPost Prodigy
8 years ago
Solved

How to filter by max value in power query

Hi experts, Could you help me to figure out how to filter a column by max value in that column in Power Query or Power BI query editor? The problem is that I do not know beforehand what max value wi...
  • MarcelBeug's avatar
    8 years ago

    Example code:

     

    let
        Source = #table(type table[Value = Int64.Type],List.Zip({{1..10}&{1..10}&{1..10}})),
        #"Filtered Rows" = Table.SelectRows(Source, each ([Value] = List.Max(Source[Value])))
    in
        #"Filtered Rows"

    You can generate base code for the 2nd step by filtering on just some value and then adjust the generated code as in the example code.