Incremental Refresh in power bi Desktop and Service
3K views
Jan 29, 2024
This video shows practical and comprehensive implementation of Incremental Refresh in Power BI Desktop and Service.
View Video Transcript
0:00
Hello everyone. In this video, I'm going to show you how to implement incremental refresh in the Power BI Desktop
0:11
And of course, how we can truly refresh our data in the Power BI Service
0:16
So let's dive in. The incremental refresh allows you to refresh only the necessary portion of your data instead of the entire data set
0:24
So let's see how we can implement this feature in the Power BI Desktop
0:29
In our sample report, you can see we have some visualizations such as the card, now the date is spanned from the 1st of January 2015 to the 31st of December 2020
0:41
So we can see the total unit card, the total sales, the number of transactions, and if we can see the slicer, the number of transactions by year table
0:51
and then we have the clustered column chart visual for the total unit by product and of course total sales by payment type
0:57
This data actually came from an SQL Server database, so I can click on this transfer data and then when I click on this recent sources, I can see this is my SQL Server database
1:09
And of course this is the particular database, sales data, and this is the table that I brought in into the Power Query Editor
1:16
So I'm going to click on cancel. Now from the F transaction data, I actually just created two dimension tables, the D product and of course the D payment type
1:26
To implement the incremental refresh, we need to set up some parameters in the Power Query Editor
1:33
So now make sure your data do contain a date column and of course the date column must have a date time data type
1:40
This is very important for the incremental refresh to work. So I'm going to click on manage parameters and I want to create two parameters
1:48
Now based on the documentation, we have to use some keyword such as the range start and the range end
1:54
So for the parameter one, I'm going to call this one range start
1:59
And of course I have to specify the data type which must be date time data type
2:03
And of course I want to filter this data from the 1st of January 2018 to the 31st of December 2018
2:12
So I'm going to come to the current value. I'm going to type in 0101 2018
2:17
We mustn't forget about the hour, minute and the second. So I'm just going to type in 00 colon 00 colon 00
2:25
And of course just specify the parameter 2. So this is going to be the range end
2:31
And of course I want to choose the date time data type. So this is going to be the 31st of December 2018 000000 columns
2:41
So click OK. Now in this case we have the range start and of course we have the range end parameters
2:49
I'm going to come to the F transaction and of course I want to apply these parameters based on the data
2:56
So I'm going to click on this filter dropdown. I want to perform date time filters
3:00
I want to choose the between operation. Now in the filter rows dialog box, we just want to stick with the basics
3:07
So we want to keep rows where the date is after or equal to the parameter that is the range start
3:15
And is before or equal to the same parameter. This is going to be the range end. That's going to be the 1st of January 2018 to the 31st of December 2018
3:26
So click OK and then the filter is applied to the data
3:30
Now what I'm going to do is just go ahead and close and apply the changes to the data model
3:35
Now when the changes occur, see what happened to our data. There we go. So you can see the 1st of January 2018 to the 31st of December
3:42
And of course the total generate, sales and so on and so forth
3:46
I'm going to come to the F transaction and right click on the table. And we want to set up the incremental refresh in the Power BI Desktop
3:53
So in this case, I'm going to choose the same F transaction table. And I'm going to toggle on this incrementally refresh this table
4:00
So click on it. Now we'll archive data starting from now. And this is going to specify 5 and this is going to be 5 years before refresh date
4:09
And we want to incrementally refresh data starting from. Again, I'm going to just type in 5 years
4:15
Now you can see data imported from the 1st of January 2018 to the 31st of December 2018 will be inclusive
4:24
So that's fine. As you can see, data will be incrementally refreshed from the 1st of January 2019 to the 31st of December 2023
4:34
So that's fine. Now we have some couple of options such as choosing the latest data in real time with direct query
4:41
Now this is premium only. And we can even choose only refresh complete years and of course detect date changes, data changes
4:48
So that's fine. I'm just going to scroll down. Now we can see the review and apply. So this is going to be 5 years before refresh date archive
4:56
And then the 5 years before refresh date and the refresh date is going to be the incremental refresh
5:02
So click on apply. And that's done. So the next thing we need to do is to go ahead and publish the report to the Power BI service
5:10
So now, of course, you need to have the necessary licenses for you to achieve this
5:14
So I'm going to choose the publish. So I'm going to publish this to my data factory that do contain a premium capacity
5:23
So I'm going to choose this data factory workspace. And then let's see
5:31
And there we go. So you can see your file was published but disconnected. That's fine
5:36
I'm just going to open this up. Openincr.pbix in Power BI service
5:40
So let's see the contents. There we go. So you can see our report is published into the Power BI service
5:48
So we can see the 1st of January 2018 to 31st of December 2018
5:54
Okay. Now the next thing we need to do is to go back to the data factory workspace
5:58
and we want to choose the schedule refresh, which is the semantic model
6:03
So click on the schedule refresh. And of course, we have to specify the gateway and cloud connections
6:09
So I'm going to click on this. Now the data actually came from my SQL server
6:14
So I'm going to map to the connection, the gateway. So this is going to be abuela-db01
6:19
And then we have the semicolon sales data. That's the name of the database
6:24
So that's fine. Click on apply. So you can see your updates to the INRC gateway connections have been applied
6:32
That's called close that. I'm going to scroll down. Now I'm going to come to the refresh
6:37
Now this is where I'm going to now specify the refresh frequency
6:42
And of course the other stuff. So I'm going to toggle this on
6:46
Of course I can choose the frequency, maybe daily or weekly. I want to actually go with the daily
6:51
That's fine. And of course, because I'm actually in London, so I'm going to stick with the UTC, Dublin, Edinburgh, Lisbon, London
6:59
So that's fine. And I want to add the time. Now when you check the current time, the current time is 2.19 a.m. in the middle of the night
7:08
So I'm going to come here and choose 2. Let's refresh by 2.30 a.m
7:15
So by 2.30 a.m. all I have to do is just refresh and then the data is included
7:19
So 2.30 a.m. Click on apply. So you can see your updates to the INRC refresh schedule changes have been applied
7:29
So that's fine. So I'm just going to wait for 10 minutes until 2.30 and then we can see the refresh taking place
7:38
So let's wait and see. You can see the time is now 2.31
7:43
So let's just refresh this page and let's see the changes. Refresh
7:52
And there you go. So you can see we have the report from the 2018 to the last date, the 31st of December 2020
8:02
So this is basically how we can implement and truly refresh our data in the Power BI service
8:08
I hope you enjoyed this video. If you do, like, share and comment. Thank you and bye for now. Cheers