Forum Discussion
Max of Column in Power Query
I'm trying to get the maximum value from colum in a table on Power Query (not Power BI) and I just can't seem to be able to do it:
- List.Max([column]) won't work.
- List.Max({[column]}) returns the value of that colum on a row.
- List.Max(Table.Column(Table, [Column])) won't work due to cyclic reference.
- Table.Max(Table, Column) like the above will have a cyclic referene.
What's the trick here? Please help.
Hi benjamin_sasin ,
What type of data are you trying to get the max value ?
Sometimes you have to refer to the table before, like:
List.Max(PreviousStepName[Column])
Ricardo
3 Replies
- camargos88Community Champion
Hi benjamin_sasin ,
What type of data are you trying to get the max value ?
Sometimes you have to refer to the table before, like:
List.Max(PreviousStepName[Column])
Ricardo
- benjamin_sasinResolver I
Okay I got it thanks.
So List.Max(#"PreviousStep"[ColumnName]) it is.
Why is this not in the List.Max function documentation? 😞
- camargos88Community Champion
Hi benjamin_sasin ,
I'm glad it worked.
Check this link: https://docs.microsoft.com/en-us/powerquery-m/list-max
It doesn't have a lot of examples, but it's good to have an idea.
Ricardo