Splitting datasets and reports into separate PBIX files is a very common way of managing Power BI reports. This approach keeps data and calculations in a more central repository which acts as a “Single Source of Truth”. But dividing sets and reports can result in a headache or two. Let our blog be your Power BI painkiller.
Once you have a Single Source of Truth, you can use it in as many reports as you’d like. The reporting layer only visualizes the data and connects to the repository through a live connection. That makes it very easy to switch data sources. The report file can easily be moved from using test data to using a production data source for example.
Those are convincing arguments for splitting reports, but it is not very practical for the developer. Searing migraines have been known to occur when you need to change measures in your extremely large dataset. The problem is that the report is connected to the dataset in the Power BI Service. When you want to see the updated measures in the report, you’ll have to republish the entire dataset to the service every time. Far from ideal for developing reports smoothly.
Luckily, there’s a solution for every problem. Yes indeed, this challenge can also easily be tackled. More specifically, by using the Hot Swap Report Connections tool from Steve Campbell. This tool enables you to quickly switch between a local live connection and a live connection to the Power BI service in your report file. In other words, it allows you to set up a local development environment that can be easily deployed to the cloud when you’re ready.
Time to get our hands dirty. I’ll start from a Power BI sample report.
The easiest way to split the Power BI file is by duplicating the PBIX file. I’ll add the suffixes report and dataset to the filenames. In the dataset file, I’ll remove all visualizations and report pages. In the report file I’ll do the opposite. I’ll keep all visualizations, but remove the entire data model such as tables and measures. The result is shown below. We end up with two broken files:
Time to fix our report. This is done by publishing the dataset to the service. Once this is done, you can add a live connection data source in the local report file. Tada, all visuals are working again. It’s magic! As you can see on the image below the data view disappeared and Connected live to the Power BI dataset: Sales & Returns Dataset in …. appeared in the status bar. Our split was successful.
Suppose we want to create a new measure for one of the visuals in the report. This would mean that we have to:
For one small change, that’s no problem. However, if you want to make some changes iteratively, you’ll have to repeat this process over and over again. In other words, you’ll often have to wait. One solution would be copying some of the visuals to the dataset temporary and test them this way. But again, this is not a proper solution. Aargh, the headache begins. But wait there is a better way!
It’s time to bring in the Hot Swap Report tool. You can install this with the Business Ops tool. This is an all-in-one external tool installer for Power BI which contains many other blog-post-worthy components.
To install Hot Swap Connections go to Add External tools in Business Ops. Next, click on the checkbox next to Hot Swap Connections in the section of Steve Campbell. Then, click on the Add External Tools button.
Once Hot Swap Report tool is installed, we’ll take the following steps:
So let’s go through these steps in a bit more detail.
First, open the dataset file and navigate to external tools in the top ribbon. Click on the Hot Swap Connections button (1). In the window that opens, go to the Connect tab (2) and press Overwrite and connect (3). A file selection dialog opens. Select the report file and continue.
If you look closely at the status bar once your file has opened, you’ll see that the text in it has changed. Now it reads Live Connected instead of Connected live to the…. . The report file is now linked to the local dataset.
Remark: you can also choose to create a new file instead of overwriting the report file by selecting the copy and connect button
It’s now time to visualize our extremely complex measure. I’ll just make a card that covers the entire page and save the report file. Next, I’ll close the file and go back to my Power BI dataset file.
The next step is quite simple. We publish the dataset so that the updated version is also available in the Power BI service.
The modified dataset is ready to go. Time to update the report. In the dataset file in Power BI desktop, open the Hot Swap Report tool. Go to the Remove tab and select Overwrite and remove live connections. This opens a file dialog where we, once again, select the report file. The live connection will be removed and the report opens with errors in the visuals.
Just as we did before, we’ll create a new live connection to our dataset file in the Power BI service.
The visuals will re-appear and in the status bar you’ll see that the report file is connected to the service again.
Finally, the last step: Publish the report to the service. Hurray we’re done! You can check the updated report in the service now.
As a final note, I would like to mention another tool that can be installed with the Business Ops tool: The ALM toolkit. Among other things, this tool makes it possible to perform deployments of schema changes in Power BI Premium without needing to refresh the entire dataset. A good video about this can be found on the Guy In A Cube YouTube channel. The link to this video is added to the references.
© 2023 Kohera
Crafted by
© 2022 Kohera
Crafted by
Cookie | Duration | Description |
---|---|---|
ARRAffinity | session | ARRAffinity cookie is set by Azure app service, and allows the service to choose the right instance established by a user to deliver subsequent requests made by that user. |
ARRAffinitySameSite | session | This cookie is set by Windows Azure cloud, and is used for load balancing to make sure the visitor page requests are routed to the same server in any browsing session. |
cookielawinfo-checkbox-advertisement | 1 year | Set by the GDPR Cookie Consent plugin, this cookie records the user consent for the cookies in the "Advertisement" category. |
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
CookieLawInfoConsent | 1 year | CookieYes sets this cookie to record the default button state of the corresponding category and the status of CCPA. It works only in coordination with the primary cookie. |
elementor | never | The website's WordPress theme uses this cookie. It allows the website owner to implement or change the website's content in real-time. |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
Cookie | Duration | Description |
---|---|---|
__cf_bm | 30 minutes | Cloudflare set the cookie to support Cloudflare Bot Management. |
pll_language | 1 year | Polylang sets this cookie to remember the language the user selects when returning to the website and get the language information when unavailable in another way. |
Cookie | Duration | Description |
---|---|---|
_ga | 1 year 1 month 4 days | Google Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors. |
_ga_* | 1 year 1 month 4 days | Google Analytics sets this cookie to store and count page views. |
_gat_gtag_UA_* | 1 minute | Google Analytics sets this cookie to store a unique user ID. |
_gid | 1 day | Google Analytics sets this cookie to store information on how visitors use a website while also creating an analytics report of the website's performance. Some of the collected data includes the number of visitors, their source, and the pages they visit anonymously. |
ai_session | 30 minutes | This is a unique anonymous session identifier cookie set by Microsoft Application Insights software to gather statistical usage and telemetry data for apps built on the Azure cloud platform. |
CONSENT | 2 years | YouTube sets this cookie via embedded YouTube videos and registers anonymous statistical data. |
vuid | 1 year 1 month 4 days | Vimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. |
Cookie | Duration | Description |
---|---|---|
ai_user | 1 year | Microsoft Azure sets this cookie as a unique user identifier cookie, enabling counting of the number of users accessing the application over time. |
VISITOR_INFO1_LIVE | 5 months 27 days | YouTube sets this cookie to measure bandwidth, determining whether the user gets the new or old player interface. |
YSC | session | Youtube sets this cookie to track the views of embedded videos on Youtube pages. |
yt-remote-connected-devices | never | YouTube sets this cookie to store the user's video preferences using embedded YouTube videos. |
yt-remote-device-id | never | YouTube sets this cookie to store the user's video preferences using embedded YouTube videos. |
yt.innertube::nextId | never | YouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen. |
yt.innertube::requests | never | YouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen. |
Cookie | Duration | Description |
---|---|---|
WFESessionId | session | No description available. |