The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
Solved! Go to Solution.
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
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