Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
I am unable to delete this post. Please assist.
Solved! Go to Solution.
Hi @Mark-JZ-Yeap ,
Try this M code (not DAX) in a new blank query:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZY5LEsAgCEPvwtoZAv7aszje/xoVtY62O5IXAqWQkCO9GJkVqiYi4zbhm6DqCnXXb64HixwRG6AsWO4EYcQRXyC/+jiP6orgG0ljUXSrD51kOxz3d1pZJ5eRdO5QrQ8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Employee ID" = _t, DOJ = _t, DOL = _t, ContinuedFor = _t]),
chgTypes = Table.TransformColumnTypes(Source,{{"DOJ", type date}, {"DOL", type date}, {"ContinuedFor", Int64.Type}, {"Employee ID", Int64.Type}}),
// Relevant steps from here =====>
mergeOnSelf = Table.NestedJoin(chgTypes, {"Employee ID"}, chgTypes, {"ContinuedFor"}, "nextEmp", JoinKind.LeftOuter),
expandDOJ = Table.ExpandTableColumn(mergeOnSelf, "nextEmp", {"DOJ"}, {"DOL_Updated"}),
repDOL_Updated = Table.ReplaceValue(expandDOJ, each [DOL_Updated], each if [DOL_Updated] > [DOL] then Date.EndOfMonth(Date.AddMonths([DOL_Updated], -1)) else null, Replacer.ReplaceValue,{"DOL_Updated"})
in
repDOL_Updated
Summary:
mergeOnSelf = Left outer merge the table on itself as [Employee ID] = [ContinuedFor].
expandDOJ = Expand the [DOJ] column from the nested table column (I also renamed it to DOL_Updated at the same time).
repDOL_Updated = Perform a conditional replace on the [DOL_Updated] column applying the required logic.
Example code turns this:
...into this:
Pete
Proud to be a Datanaut!
Hi @Mark-JZ-Yeap ,
Try this M code (not DAX) in a new blank query:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZY5LEsAgCEPvwtoZAv7aszje/xoVtY62O5IXAqWQkCO9GJkVqiYi4zbhm6DqCnXXb64HixwRG6AsWO4EYcQRXyC/+jiP6orgG0ljUXSrD51kOxz3d1pZJ5eRdO5QrQ8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Employee ID" = _t, DOJ = _t, DOL = _t, ContinuedFor = _t]),
chgTypes = Table.TransformColumnTypes(Source,{{"DOJ", type date}, {"DOL", type date}, {"ContinuedFor", Int64.Type}, {"Employee ID", Int64.Type}}),
// Relevant steps from here =====>
mergeOnSelf = Table.NestedJoin(chgTypes, {"Employee ID"}, chgTypes, {"ContinuedFor"}, "nextEmp", JoinKind.LeftOuter),
expandDOJ = Table.ExpandTableColumn(mergeOnSelf, "nextEmp", {"DOJ"}, {"DOL_Updated"}),
repDOL_Updated = Table.ReplaceValue(expandDOJ, each [DOL_Updated], each if [DOL_Updated] > [DOL] then Date.EndOfMonth(Date.AddMonths([DOL_Updated], -1)) else null, Replacer.ReplaceValue,{"DOL_Updated"})
in
repDOL_Updated
Summary:
mergeOnSelf = Left outer merge the table on itself as [Employee ID] = [ContinuedFor].
expandDOJ = Expand the [DOJ] column from the nested table column (I also renamed it to DOL_Updated at the same time).
repDOL_Updated = Perform a conditional replace on the [DOL_Updated] column applying the required logic.
Example code turns this:
...into this:
Pete
Proud to be a Datanaut!
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 12 | |
| 11 | |
| 11 | |
| 7 | |
| 6 |