Forum Discussion
TD
Nov 08, 2024Copper Contributor
Extend Value to all Weeks going forward
Hi, My first post to community. I need help to extend value for all week endings from now. My Week ends on Saturday. First table is my current output from Power query where I have closing stock for e...
Lorenzo
Nov 08, 2024Silver Contributor
Attached is a slightly different approach that might be a bit better in term of perf. (not sure - to be tested...)
Lorenzo
Nov 09, 2024Silver Contributor
Forgot one point. If it happens you have disordered [Week Ending] by [Item] add a Sort step at the end of the query, sorting by [Item] then by [Week Ending]. Something like:
SortedRows = Table.Sort( <previous_step_name>, {{"Item", Order.Ascending}, {"Week Ending", Order.Ascending}} )Reason this could happen: ExpandWeeklyValue does a Merge operation. The latter cannot guarantee an ordered set of records. This is - to my knowledge - currently undocumented. Same thing can happen with Grouping operation
- TDDec 13, 2024Copper Contributor
Thanks Lorenzo. It worked. Apologies for delay in response. Thank you so much for your help.