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,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.