Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
benjamin_sasin
Resolver I
Resolver I

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.

1 ACCEPTED SOLUTION
camargos88
Community Champion
Community 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



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

3 REPLIES 3
camargos88
Community Champion
Community 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



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Okay I got it thanks.

 

So List.Max(#"PreviousStep"[ColumnName]) it is.

 

Why is this not in the List.Max function documentation? 😞

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



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors