Forum Discussion
Need to Insert Rows for Months between two respective Months listed in the same Date column
- Anonymous2 years ago
Hi CincyKJ ,
I suggest you add a calendar table like this one:In the Power Query, choose the Before Table, and select Merge Queries:
Choose column Rate and choose fill down:And the final output is as below:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQ31DcyMDJW0lEyVYrViVYyQQiYgQUMDRAi5hARiIAJUMBCKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Effective Date" = _t, Rate = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Effective Date", type date}, {"Rate", Int64.Type}}), #"Merged Queries" = Table.NestedJoin(#"Changed Type", {"Effective Date"}, Calendar, {"Date"}, "Calendar", JoinKind.FullOuter), #"Expanded Calendar" = Table.ExpandTableColumn(#"Merged Queries", "Calendar", {"Date"}, {"Date"}), #"Sorted Rows" = Table.Sort(#"Expanded Calendar",{{"Date", Order.Ascending}}), #"Filled Down" = Table.FillDown(#"Sorted Rows",{"Rate"}) in #"Filled Down"
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - 2 years ago
Hi Dino Tao.
Thank you ever so much. "Merging Calendars" worked perfectly for me!
Hi CincyKJ ,
I suggest you add a calendar table like this one:
In the Power Query, choose the Before Table, and select Merge Queries:
Choose column Rate and choose fill down:
And the final output is as below:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQ31DcyMDJW0lEyVYrViVYyQQiYgQUMDRAi5hARiIAJUMBCKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Effective Date" = _t, Rate = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Effective Date", type date}, {"Rate", Int64.Type}}),
#"Merged Queries" = Table.NestedJoin(#"Changed Type", {"Effective Date"}, Calendar, {"Date"}, "Calendar", JoinKind.FullOuter),
#"Expanded Calendar" = Table.ExpandTableColumn(#"Merged Queries", "Calendar", {"Date"}, {"Date"}),
#"Sorted Rows" = Table.Sort(#"Expanded Calendar",{{"Date", Order.Ascending}}),
#"Filled Down" = Table.FillDown(#"Sorted Rows",{"Rate"})
in
#"Filled Down"
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Dino Tao.
Thank you ever so much. "Merging Calendars" worked perfectly for me!