Forum Discussion
Incremental Refresh - building historical model week by week
- 1 year ago
Hi unknown917,
If the parameters are not set up correctly, this issue will occur.
Ensure that your RangeStart and RangeEnd parameters are correctly named (case-sensitive) and have the Date/Time data type, not just Date.
If the issue persists, please share a screenshot of your parameter setup so we can identify any mistakes.FYI please refer below document,
Configure incremental refresh for Power BI semantic models - Power BI | Microsoft Learn
If this post helps, then please consider Accepting as the solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
Yes, it can be achieved using Incremental Refresh in Power BI.Try to do this
Create RangeStart and RangeEnd parameters in Power Query to filter your Date column dynamically (e.g., last 7 days). Configure Incremental Refresh to retain historical data (e.i in your case, 2 years) while refreshing only the latest week's data, and publish it to the Power BI Service.
- unknown9171 year ago
Helper IV
Akash_Varuna - Thank you for your quick response! I am not terribly familiar with M Code. Any chance to steer me in the right direction for the code necessary for last 7 days?
- unknown9171 year ago
Helper IV
I've tried a couple of things fumbling around and haven't cracked it. Here's what I've tried so far:
Last Week Start Date = (Today()-WEEKDAY(TODAY())+1)-7
Last Week End Date = (Today()-WEEKDAY(TODAY())+1)-1
No syntax errors, but once filtered, my query yields no results. Suggestions?
Much appreciated!
- Akash_Varuna1 year ago
Super User
Try this
let// Replace with your table
Source = YourTable,
// Define the RangeStart and RangeEnd parameters dynamically
RangeStart = #datetime(), // Adjust the start date
RangeEnd = #datetime(), // Adjust the end date
// Filter rows based on the RangeStart and RangeEnd
FilteredRows = Table.SelectRows(Source, each [Date] >= RangeStart and [Date] < RangeEnd)
in
FilteredRows
- unknown9171 year ago
Helper IV
hello,
I have tried this, but when I attempt to set the incremental refresh, it says I haven't set up parameters yet...??