Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
In my previous blog I explained about Bootstrapped data loading and in this blog I am going to explain how you can automate partition refreshes using a tool developed using python. Please read that blog before checking this.
Automating Partition Refreshes with Python
To simplify the process, I developed a Python-based tool that automates partition refreshes.
Download link is in the bottom
It comes in two versions:
Version 1: Runs from a local machine
Version 2: Runs from a Microsoft Fabric Notebook using the Semantic Link library
Both versions use the Enhanced Refresh API to refresh partitions efficiently.
Version 1: Local Python Tool
This version includes three key files:
Requirements:
Configuration Steps:
Open config.py and provide the required values. Adjust parameters such as delay, batch size, maximum parallelism, retry count, and timeout based on your environment.
2. In main.py, specify the table name and incremental refresh policy details.
3. Execute main.py script.
How It Works:
You can monitor progress through Power BI Service refresh history
or verify partition data in SSMS by expanding the table’s Partitions node.
After completing all the batches, it will stop the execution like below
All the partitions are loaded successfully
You might have observed, the first batch started at 8:26 AM and last batch completed at 11:00 AM. The whole process took 2.5 hours and the script did the whole job on its own. 🙂
Version 2: Microsoft Fabric Notebook
The second version is a Microsoft Fabric Notebook (Bootstrapped Data Load.ipynb) and leverages the Semantic Link library.
It does not require a Service Principal since it uses the current user’s identity. The user running the notebook must have appropriate permissions in the workspace hosting the semantic model.
Provide the necessary configuration values in the designated notebook cell and execute it. Similar to Version 1, it refreshes partitions sequentially in batches.
Points to Remember
Conclusion
The Bootstrapped Initial Refresh technique is an effective way to overcome the limitations of the initial full load in Power BI incremental refresh. By first creating an empty table and then refreshing partitions in controlled batches, you can establish your model structure without encountering timeout, memory, or workload management issues.
This method ensures a smooth onboarding of large datasets into Power BI while maintaining optimal resource usage and performance.
You can download the tool from my git repository. I am not an expert in python, please feel free to correct my code or suggest any enhancements.
Hope you learned something new from this blog, do share your thoughts in the comments section.
Happy Learning!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.