Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
I am new to Power BI and I am trying to create a new column based on date information in another (in Power Query).
I effectively want my next column to display the NEXT date in the column it is referencing. If there is no next date then return TODAYs date.
Current:
Goal output:
I have been playing aroud with Dates and List.Max and List.Remove but not getting the output I am looking for.
Any help is greatly appreciated.
Thank you.
Solved! Go to Solution.
Hi @Tdl1982
You are only looking at dates regardless of location, here is one way. Please provide sample data in a format which people can copy in the future
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDUByIjA0NLJR0lR6VYnWglQ1MMISNLJCEnpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Paid = _t, Where = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Paid", type date}, {"Where", type text}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each try #"Added Index"[Paid]{[Index]+1} otherwise Date.From( DateTime.LocalNow()))
in
#"Added Custom"
Hi @Tdl1982
You are only looking at dates regardless of location, here is one way. Please provide sample data in a format which people can copy in the future
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDUByIjA0NLJR0lR6VYnWglQ1MMISNLJCEnpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Paid = _t, Where = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Paid", type date}, {"Where", type text}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each try #"Added Index"[Paid]{[Index]+1} otherwise Date.From( DateTime.LocalNow()))
in
#"Added Custom"
Hello Vera_33, Thank you for this. Since I posted I worked out using two index tables and then merging together. Your way is even more efficient again. Thank you!
Hi @Tdl1982
You are only looking at dates regardless of location, here is one way. Please provide sample data in a format which people can copy in the future
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDUByIjA0NLJR0lR6VYnWglQ1MMISNLJCEnpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Paid = _t, Where = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Paid", type date}, {"Where", type text}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each try #"Added Index"[Paid]{[Index]+1} otherwise Date.From( DateTime.LocalNow()))
in
#"Added Custom"
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 |