Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
bkan
Helper I
Helper I

Incremental Refresh by Year and not by date

Is it possible to do incremental refres by YEAR rather than start and end dates?

Thanks

1 ACCEPTED SOLUTION

You created a Power Query Step called "where"  and it will produce a logical true/false but otherwise be completely disjointed from your table.

 

 

 

let
Source = Sql.Databases("server\instance"),
DataWareHouse = Source{[Name="Database"]}[Data],
dbo_OverView = DataWareHouse{[Schema="dbo",Item="_OverView"]}[Data],
Filtered = Table.SelectRows(dbo_OverView, each RangeStart <= #datetime([WorkDate_Year],1,1,0,0,0) and #datetime([WorkDate_Year],1,1,0,0,0) < RangeEnd),
#"Renamed Columns" = Table.RenameColumns(Filtered,{{"LOB", "Services"}, {"ClientName", "Client Name"}})
in
#"Renamed Columns"

 

 

View solution in original post

12 REPLIES 12
lbendlin
Super User
Super User

Partitions can be by year, quarter, month, or day.

 

So yes, you can specify yearly partitions.  You will still need to provide a datetime column for the RangeStart and RangeEnd parameters  (for example the first day of the year)

@lbendlin  thanks. The issue here is in the backend we have a VIEW and are converting date into YEAR and MONTH, so if we bring in the date we  are runnig into millions of records per year, for example we average 12 to 15 mil rows if we add the date field.

Thanks

You don't need to materialize the field.

 

RangeStart <= #datetime([year],1,1,0,0,0) and #datetime([year],1,1,0,0,0) < RangeEnd

@lbendlin so my understanding is create 2 params Rangestart and RangeEnd and do it in PBI Desktop?  What does  #datetime([year],1,1,0,0,0)  do is that a PBI Function?

Thanks

that is a PowerQuery M function that creates a datetime value from your [year] column. First day of the year, midnight.

@lbendlin  thanks . I created the Paramete "RangeStart" and "RangeEnd". Please tell me where to write the M function. My advanced editor shows the code as

let
Source = Sql.Databases("DEV"),
QADataWareHouse = Source{[Name="QADataWareHouse"]}[Data],
dbo_Report_OverView = QADataWareHouse{[Schema="dbo",Item="Report_OverView"]}[Data],
#"Renamed Columns" = Table.RenameColumns(dbo_Report_OverView,{{"LOB", "Services"}, {"ClientName", "Client Name"}})
in
#"Renamed Columns"

The filter needs to be part of the query for the data you want to load into Power BI incrementally. Add the filter as soon as possible in the code.

 

https://learn.microsoft.com/en-us/power-bi/connect-data/incremental-refresh-overview

@lbendlin Thanks I tried the below code in the Advanced Editor and it is still refreshing all the YEARS and not just the current year

 

You created a Power Query Step called "where"  and it will produce a logical true/false but otherwise be completely disjointed from your table.

 

 

 

let
Source = Sql.Databases("server\instance"),
DataWareHouse = Source{[Name="Database"]}[Data],
dbo_OverView = DataWareHouse{[Schema="dbo",Item="_OverView"]}[Data],
Filtered = Table.SelectRows(dbo_OverView, each RangeStart <= #datetime([WorkDate_Year],1,1,0,0,0) and #datetime([WorkDate_Year],1,1,0,0,0) < RangeEnd),
#"Renamed Columns" = Table.RenameColumns(Filtered,{{"LOB", "Services"}, {"ClientName", "Client Name"}})
in
#"Renamed Columns"

 

 

thanks can you please delete the solution as by mistake i have some sensitive info

I cleaned it up.

will implement and update you

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.