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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Netrelemo
Helper IV
Helper IV

A function on a list

I need a function to find the highest value in one column of a 3 column list. How do I do this? 

 

let
    Source = (#"My3ColList"  as any) => let

    LatestDate = List.Max([Source].[Period]), type date}})
in
Source
in Source

 

let
    Source = (Table as table) => Table.Column(Table, "Period" as text) as list,
    pSource = (list as any) => List.Max(list),
    x = pSource(Actuals)
in
    x
1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Netrelemo ,

 

Try the following function:

let
    Source = (EnterTable  as any, EnterColumn as any)  => List.Max(Table.Column(EnterTable, EnterColumn as text))
     
in
    Source

 

Then invoking function MaxValue:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtQFQiUdJUMDAyDpqBSrAxU2BQubgkSdEaJmUMVAwkkpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Period = _t, Value = _t, Column2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Period", type date}, {"Value", Int64.Type}, {"Column2", type text}}),
    #"Max Value" = MaxValue(#"Changed Type","Period")

in
    #"Max Value"

v-kkf-msft_0-1622600505191.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @Netrelemo ,

 

Try the following function:

let
    Source = (EnterTable  as any, EnterColumn as any)  => List.Max(Table.Column(EnterTable, EnterColumn as text))
     
in
    Source

 

Then invoking function MaxValue:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtQFQiUdJUMDAyDpqBSrAxU2BQubgkSdEaJmUMVAwkkpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Period = _t, Value = _t, Column2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Period", type date}, {"Value", Int64.Type}, {"Column2", type text}}),
    #"Max Value" = MaxValue(#"Changed Type","Period")

in
    #"Max Value"

v-kkf-msft_0-1622600505191.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

lbendlin
Super User
Super User

Please provide sample data in usable format (not as a picture) and show the expected outcome.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.