Forum Discussion
gvg
Post Prodigy
8 years agoHow 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...
- 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.
MarcelBeug
Community Champion
8 years agoThat's correct, but you are still refering to the second row: {1} doesn't refer to a value, but to a row number.
Edit: so actually you don't need the Index column at all...
gvg
Post Prodigy
8 years agoOK, understand. Thanks!