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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

PowerBI Query

I would like to display only Max data from this below table in PowerQuery.

 

tried List.Max or List.Table . But not working. How to extract the max date and display in the same column itself?

 

ja832153_0-1612188562175.png

 

ja832153_1-1612188757479.png

 

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

I'm not sure what you want the result to look like.  I don't know what you mean by extract the max date and display in the same column itself ?

Do you want just a single value like this?

maxdate.png

 

Here's the code that generates this from your sample data and you can download this file with the code.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Tcq5DQAgEAPBXogJbB9vLYj+24AE4XA1u1YCg4KQdr4hzR/hUgI/qktz6S7DY9pGmJAuerIP", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Date", each Date.FromText(Text.Middle([Column1],4,4) & " " & Text.Start([Column1],2) & " " & Text.Middle([Column1],2,2), "en-US")),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Column1"}),
    #"Filtered Rows" = Table.SelectRows(#"Removed Columns", let latest = List.Max(#"Removed Columns"[Date]) in each [Date] = latest)
in
    #"Filtered Rows"

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

3 REPLIES 3
PhilipTreacy
Super User
Super User

Hi @Anonymous 

I'm not sure what you want the result to look like.  I don't know what you mean by extract the max date and display in the same column itself ?

Do you want just a single value like this?

maxdate.png

 

Here's the code that generates this from your sample data and you can download this file with the code.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Tcq5DQAgEAPBXogJbB9vLYj+24AE4XA1u1YCg4KQdr4hzR/hUgI/qktz6S7DY9pGmJAuerIP", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Date", each Date.FromText(Text.Middle([Column1],4,4) & " " & Text.Start([Column1],2) & " " & Text.Middle([Column1],2,2), "en-US")),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Column1"}),
    #"Filtered Rows" = Table.SelectRows(#"Removed Columns", let latest = List.Max(#"Removed Columns"[Date]) in each [Date] = latest)
in
    #"Filtered Rows"

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

I think you will need to split the column into day, month and year, then combine back together with a date separator like 31/01/2020 and then convert.

 

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

amitchandak
Super User
Super User

@Anonymous , this in text format (also not in YYYYMMDD, which can give max in text format), try to change the datatype to date and then try. Or create a new column from it making it has a date and then try max.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.