Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi all,
I have a question. I have a datasource which consists of a few columns followed by multiple status columns, each consisting of a combination of 3. What I need is the last status combination of columns. That can sometimes be the first status, sometimes the 4th or 5th.
What I have:
What I need:
The example above is as clarifying. I hope someone can help me.
Thanks in advance!
Sample PBIX file attached
pls try is
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDUAyIjAyNjJR2lgKL89KLU4mIg09BUz8AIJu7o5AwkXfLzUoGUkQGSjLu7F5BER7E6EINNYcqgWg2N9AzMYGLOwSlYtGKYYQ5TH1ySWFQCpIGWIwR9XV3R3G2AJOsSHIwma4QhC3OaBZqpsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, #"Status 1" = _t, #"Date 1" = _t, #"Person 1" = _t, #"Status 2" = _t, #"Date 2" = _t, #"Person 2" = _t, #"Status 3" = _t, #"Date 3" = _t, #"Person 3" = _t, #"Status 4" = _t, #"Date 4" = _t, #"Person 4" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Status 1", type text}, {"Date 1", type date}, {"Person 1", type text}, {"Status 2", type text}, {"Date 2", type date}, {"Person 2", type text}, {"Status 3", type text}, {"Date 3", type date}, {"Person 3", type text}, {"Status 4", type text}, {"Date 4", type date}, {"Person 4", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","",null,Replacer.ReplaceValue,Table.ColumnNames(#"Changed Type")),
#"Added Custom" = Table.AddColumn(#"Replaced Value", "LastStatus", each List.LastN(
List.Select(
Record.FieldValues(_),each _<> null),3){0}),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Lastdate", each List.LastN(
List.Select(
Record.FieldValues(_),each _<> null),4){1}),
#"Added Custom2" = Table.AddColumn(#"Added Custom1", "Lastpersone", each List.LastN(
List.Select(
Record.FieldValues(_),each _<> null),5){2})
in
#"Added Custom2"
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.