Forum Discussion
Keep rows while add new row for each day's entry
Hello All,
I am trying to get data from worldmeter.com. I import the daily cases table and filter to keep only Jordan. Then I add today's date in a new column.
The worldmeter table is the same source but it overwrites with new data everyday. But I want to keep old records. So everyday when the dashboard refreshs the query keeps previous days' rows and add a new row for the current day with its date without overwriting the rows I already got.
Is it possible on power query?
3 Replies
- Jimmy801
Community Champion
Hello ramhariessentia
there were written already a lot of posts here in this forum. Just search for "incremental refresh"
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy - MattAllington
Community Champion
There is no persistent storage in Power Query. Read my article here for a solution. https://exceleratorbi.com.au/keeping-track-of-changes-on-a-website-power-bi/
- v-alq-msft
Community Support
Hi, Anonymous
I'd like to suggest you create a function to get the corresponding data and add a column called 'DateTime' for each call. Finally you may use Table.Combine to get the final result.
The function is like below. I tested with excel connector. You may replace it with web connector. 'Filter' and 'Res' steps are really important.
= (Parameter1) => let Source = Excel.Workbook(Parameter1, null, true), Table_Table = Source{[Item="Table",Kind="Table"]}[Data], Filter = Table.SelectRows(Table_Table,each [Name]="Jordan"), Res = Table.AddColumn(Filter,"DateTime",each DateTime.LocalNow()) in ResResult:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.