Forum Discussion
Dynamic Column Update
- 4 years ago
The purpose of Power Query is to transform existing source data. If you are trying to include historical forecast values then those should be present in the source data somewhere. It sounds like they are not. The best option I think would be to either create a file that contains historical forecast amounts with their applicable dates (this could easily be done with Power Automate), or use Power Query to read all of the weekly files and aggregate the weekly amounts.
Hello jennratten,
Thank you very much for your reply and efforts.
I tried your suggestion and the Replace querys work. The issue now is, once the varTargetColumn value changes, the old changed value changes back to abc123.
I mean, once the week number changes from 21 to 22, the column for 22 becomes zzz and the column for 21 is changed back to abc123.
I want both column to be zzz. Essentially, replace if the coulm value matches, else leave the values as it is(Not as it is in the source, the values might have changed since what was in the source. For example, we might have some value for week 20, I dont want it to change it back to what it was before the replace query updated it)
Let me know if this makes sense.
Thank you for all your help.
Best Regards
Where are the new values coming from? Is there another table with the new values and dates?
- Anonymous4 years agoNot applicable
My new values are comming from another table's column = 'Project'[forecast]
There is no date column, the forecast keeps changing, so I am trying to get a snapshot summary of forecast for each week. That is, save the forecast for week 20, As the week ends, the Summary value of forecast for week 20 is locked, and we move on to update week 21 forecast.
Please let me know if you need any other info.
Thank you for your help!- jennratten4 years agoSuper User
The purpose of Power Query is to transform existing source data. If you are trying to include historical forecast values then those should be present in the source data somewhere. It sounds like they are not. The best option I think would be to either create a file that contains historical forecast amounts with their applicable dates (this could easily be done with Power Automate), or use Power Query to read all of the weekly files and aggregate the weekly amounts.
- Anonymous4 years agoNot applicable
jennratten
How if we add a new column every week?
As the week change from 20 to 21, we add an new column of 21 and update its value. Will this help in restoring column 20's updated values?
Please let me know.
Thank you!