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
Petri
Frequent Visitor

Getting a unique value of the latest date

I would like power query to return just one row:  the latest date. I have always used a workaround (select the latest date, then group by date column) but I wonder if one could do this more effectively by List.Distinct.

 

Attempts trying to nest it around List.Max did not work:

#"Filtered Rows" = Table.SelectRows(ATable, List.Distinct(let latest = List.Max(ATable[DateCharac]) in each [DateCharac] = latest))
#"Filtered Rows" = Table.SelectRows(ATable, let latest = List.Distinct(List.Max(ATable[DateCharac])) in each [DateCharac] = latest)

 

This one returned everything:

#"Filtered Rows" = Table.SelectRows(ATable, let latest = List.Max(ATable[DateCharac]) in each [DateCharac] = latest),
#"Distinct" = List.Distinct(#"Filtered Rows"[DateCharac])

 

Please let me know what goes wrong above - what would be the best way to get the latest date in one row?

1 ACCEPTED SOLUTION

Hi @Petri 

 

Do you want to put custom1, custom2, etc. in different columns of a single row? Something like below?

vjingzhang_0-1664957693028.png

custom1 = #table({"Latest Date 1", "Latest Date 2"}, {{List.Max(ATable[Date]), List.Max(BTable[Date])}})
in
custom1

 

If it's not what you want, can you provide the expected table you want to get with some sample data? 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

4 REPLIES 4
v-jingzhang
Community Support
Community Support

Hi @Petri 

 

Is this what you want?

= #table({"Latest Date"},{{List.Max(ATable[Date])}})

vjingzhang_0-1664942323697.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Thank you! This indeed makes it easier and avoids navigating to the table and field first. I even managed to get the values from several tables:

custom1 = #table({"Latest Date"},{{List.Max(ATable[Date])}}),
custom2 = #table({"Latest Date"},{{List.Max(BTable[Date])}})
in
custom1

 

...althoug I still struggle how to get the custom1, custom2, etc. in different columns.

 

Hi @Petri 

 

Do you want to put custom1, custom2, etc. in different columns of a single row? Something like below?

vjingzhang_0-1664957693028.png

custom1 = #table({"Latest Date 1", "Latest Date 2"}, {{List.Max(ATable[Date]), List.Max(BTable[Date])}})
in
custom1

 

If it's not what you want, can you provide the expected table you want to get with some sample data? 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Thanks a lot for your quick reply - this was exactly what I was after.

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.