Forum Discussion
Dataflows Incremental Refresh
- 1 year ago
If the difference in last available dates between countries remains constant, then setting the incremental refresh to the earliest date (e.g., 1st Jan 2025 for India) will ensure that all countries get refreshed correctly. Taking the example you shared, you can set the incremental refresh policy as
"Refresh Last 2 Months and store last 2 years"
this will ensure that all countries data will get refreshed.
However, if the date difference changes dynamically, this approach won't work because some countries might not refresh correctly. To avoid this issue, you need to write the M code in such a way that,
1. it will identify the maximum date available for each country, example code
LastDatePerCountry = Table.Group(Source, {"Country"}, {{"MaxDate", each List.Max([DateColumn]), type date}})2. Take the minimum date of MaxDate
MinofAllMaxDates = List.Min(Table[MaxDate])3. If MinofAllMaxDates is less than RangeStart parameter then consider MinofAllMaxDates else RangeStart
4. Then use the RangeStart and RangeEnd paramters to filter your actual table.
https://learn.microsoft.com/en-us/power-query/dataflows/incremental-refresh
https://learn.microsoft.com/en-us/fabric/data-factory/dataflow-gen2-incremental-refresh
Need a Power BI Consultation? Hire me on Upwork
Connect on LinkedIn
Did I answer your question? Mark my post as a solution! If I helped you, click on the Thumbs Up to give Kudos.
Proud to be a Super User!
Hi ArvindJha,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.