How to Remove Direct Query Connection in Power BI
Switching your Power BI data connection from DirectQuery to Import mode can instantly boost your report’s performance and unlock a wider range of DAX functions. If you've been working with a slow, limited DirectQuery report, making this change is a game-changer. This article will walk you through exactly why and when you should switch, and then provide a step-by-step guide to removing the DirectQuery connection in favor of Import mode.
DirectQuery vs. Import Mode: A Quick Refresher
Before changing your connection type, it’s helpful to understand the fundamental differences between DirectQuery and Import mode. Each has its place, and choosing the right one depends entirely on your needs.
What is DirectQuery?
DirectQuery creates a live, direct connection to your data source. When you or a user interacts with a visual in your Power BI report (like clicking a filter or a bar chart), Power BI sends a query directly to the source database to fetch the necessary data. Nothing is stored inside your Power BI file itself.
- Pros: Ideal for massive datasets that won’t fit into memory and situations that require absolutely real-time data. The moment data is updated in the source, it's reflected in your report.
- Cons: Report performance can be sluggish, as every interaction waits for the source database to respond. It also comes with significant limitations in Power Query transformations and the DAX formulas you can use.
What is Import Mode?
Import mode, on the other hand, loads a copy of your data directly into the Power BI file (.PBIX). The data is compressed and stored in-memory, powering all your visuals and calculations. This internal data model is then periodically updated through scheduled refreshes.
- Pros: Blazing-fast performance, since all operations happen within Power BI's optimized engine. You get access to the full suite of DAX functions and Power Query transformations without restrictions.
- Cons: Data is only as fresh as your last refresh, not real-time. There are also limits to how much data you can import, which can be a concern for extremely large datasets (though the limits are quite generous for most use cases).
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
When Should You Switch from DirectQuery to Import?
So, which mode is right for you? While DirectQuery is powerful for specific scenarios, many users find that Import mode provides a much better experience for day-to-day analytics. Here are a few common reasons to make the switch:
- Your reports are frustratingly slow. If clicking on a slicer makes you want to go grab a coffee while it loads, your user experience is suffering. Switching to Import mode will make interactions crisp and instantaneous.
- You need to use powerful DAX functions. Many powerful time intelligence functions and complex calculated columns aren't available in DirectQuery. If you find yourself hitting a wall with DAX, importing your data is the solution.
- You want to reduce the load on your source database. Constantly pinging a production database with queries from dozens of report users can strain its performance. Import mode offloads that analytical work to Power BI's service.
- Real-time data isn't a strict requirement. If a daily, hourly, or even 15-minute refresh cadence is perfectly acceptable for your team's decisions, then the 'always live' benefit of DirectQuery is unnecessary overhead. For most marketing and sales reports, a daily refresh is more than enough.
Step-by-Step Guide to Removing a DirectQuery Connection
Ready to unlock faster performance? Changing your connection from DirectQuery to Import is surprisingly straightforward. Follow these steps carefully.
Crucial First Step: Back Up Your Report
Before you make any structural changes to your Power BI file, always create a backup. Save a copy of your .PBIX file with a name like "MyReport_Backup_YYYY-MM-DD.pbix". If anything goes wrong, you'll have a safe version to revert to. Don't skip this step!
Step 1: Open Your Report in Power BI Desktop
Make sure you are working with the original .PBIX file in Power BI Desktop, as these changes can't be made in the Power BI Service (the online version).
When you open your report, you can confirm it's in DirectQuery mode by looking at the bottom-right corner of the status bar. It will typically say "Storage Mode: DirectQuery" and state that you're connected live.
Step 2: Navigate to the Model View
On the left-hand side of the Power BI Desktop window, you'll see three icons: Report, Data, and Model. Click on the Model view icon. This is where you can see the relationships between all the tables in your dataset.
You’ll notice that in DirectQuery mode, the Data view icon is disabled, since no data is actually stored in the file.
Step 3: Change the Storage Mode for Each Table
Your goal is to change the storage mode for every table from DirectQuery to Import. This has to be done one table at a time, but it’s quick.
- In the Model view, click on the first table in your data model to select it.
- With the table selected, look for the Properties pane, usually on the right side of the screen. If you don't see it, go to the "View" ribbon at the top and make sure "Properties" is checked.
- In the Properties pane, scroll down until you see the Advanced section.
- Click on the dropdown menu for Storage mode. It will currently show DirectQuery.
- Select Import from the list.
A warning window will pop up explaining the implications of your change - namely, that switching will load data into the model and may require setting up refreshes in the Power BI Service. Click OK.
Repeat this process for every single table that is currently in DirectQuery mode. After you switch the first table to 'Import', you will likely see a yellow warning bar appear at the top prompting you to refresh. Wait until you have changed all your tables before you refresh the data.
Step 4: Refresh Your Data and Verify the Change
Once you've switched all your tables to Import mode, it's time to pull the data into your Power BI file. Go to the "Home" ribbon and click the Refresh button. Power BI will now connect to your data source and load all the data into your model.
Once the refresh is complete, you can verify the change in a few ways:
- The status bar at the bottom-right corner will no longer mention DirectQuery.
- The Data view icon on the left will now be enabled. Clicking it will show you the actual data tables stored in your model.
- The data and report visuals will now perform much faster.
- If you select any table in the Model view again, the Storage mode in Properties will now show Import.
Congratulations! You have successfully removed the DirectQuery connection and converted your report to Import mode.
What to Do After You Switch to Import Mode
Your work isn't quite done. An imported model needs a bit of care to stay up-to-date and efficient.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
1. Set Up a Scheduled Refresh
Because your data is no longer live, you must tell the Power BI Service when to update it. After you publish your new report file, go to your workspace online, find your dataset, and configure a scheduled refresh. You can set it to refresh as often as every half hour. If your data source is on-premise (e.g., a local SQL Server), you'll need to configure a Power BI Gateway to let the cloud service securely access your data.
2. Optimize Your Data Model
Now that you're storing data inside your file, it's good practice to keep things lean. Open the Power Query Editor ('Transform data') and:
- Remove unused columns: If your source table has 50 columns but you only use 10 in your report, delete the other 40. This can drastically reduce your file size.
- Check data types: Make sure columns are set to the correct type (e.g., Whole Number instead of Text where appropriate).
- Filter unnecessary rows: If you only need data from the last two years, apply a filter to remove older data that won't be used in the report.
A smaller, cleaner model will perform better and refresh faster.
Final Thoughts
Switching from DirectQuery to Import mode is a powerful way to accelerate report performance, unlock the full capabilities of DAX, and provide a better analytics experience for your team. The process is quick, but it fundamentally changes how your report interacts with your data, introducing the need for scheduled refreshes.
Many users find that managing gateways, data refreshes, and performance tuning inside traditional BI tools takes valuable time away from actual analysis. At Graphed, we automate all of that. We handle the complexities of connecting to your marketing and sales platforms, keeping data live and performance fast, without forcing you down a technical rabbit hole of storage modes and refresh schedules. You can just ask questions in plain English - like "create a dashboard showing my Facebook Ads spend versus Shopify revenue" - and instantly get live, interactive dashboards built for you automatically.
Related Articles
How to Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.