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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

PowerBI - max record with min date

Hi
I have the table attached and I want to have the output table attached.
Power BI has to get the last owned vehicle by person and then get when it was owned.

vehicle.JPG

1 ACCEPTED SOLUTION
slorin
Super User
Super User

Hi

let
Source = YourSource,
FillDown = Table.FillDown(Source,{"Name"}),
Type = Table.TransformColumnTypes(FillDown,{{"Date owned", type date}}),
Group = Table.Group(
Type,
{"Name", "Own"},
{{"Max", each List.Max([Date owned]), type nullable date},
{"Since", each List.Min([Date owned]), type nullable date}},
GroupKind.Local),
Sort = Table.Sort(Group,{{"Max", Order.Descending}}),
Distinct = Table.Distinct(Sort, {"Name"})
in
Distinct

 

 

Stéphane

View solution in original post

1 REPLY 1
slorin
Super User
Super User

Hi

let
Source = YourSource,
FillDown = Table.FillDown(Source,{"Name"}),
Type = Table.TransformColumnTypes(FillDown,{{"Date owned", type date}}),
Group = Table.Group(
Type,
{"Name", "Own"},
{{"Max", each List.Max([Date owned]), type nullable date},
{"Since", each List.Min([Date owned]), type nullable date}},
GroupKind.Local),
Sort = Table.Sort(Group,{{"Max", Order.Descending}}),
Distinct = Table.Distinct(Sort, {"Name"})
in
Distinct

 

 

Stéphane

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors