How to Delete Direct Query in Power BI
Setting up Power BI with a DirectQuery connection can seem like the perfect solution, especially when you need real-time data or have a massive dataset. But when dashboards start lagging and every slicer click takes forever to load, you might realize DirectQuery isn't the right fit. This guide will walk you through exactly how to remove a DirectQuery connection by changing it to the much faster Import mode, explaining the why, the how, and what to watch out for along the way.
First, Why Switch from DirectQuery?
DirectQuery is a powerful feature, but it comes with a specific set of trade-offs. It doesn’t load a copy of the data into your Power BI file. Instead, every time you interact with a chart or filter, Power BI sends a query directly to the underlying data source (like a SQL server). This is great for real-time visibility but often comes at a cost.
You might want to move away from DirectQuery for a few common reasons:
- Slow Performance: This is the number one complaint. If your source database is slow or you have complex visuals, report interactivity can grind to a halt. Each click results in a new query, forcing users to wait for visuals to render. Switching to Import mode loads the data directly into your Power BI file, making interactions nearly instantaneous.
- DAX Limitations: DirectQuery restricts the use of many powerful DAX functions, especially time intelligence functions. If you've ever tried to build a custom calendar table or use certain iterators and got an error message, DirectQuery was likely the culprit. Import mode unlocks the full power of the DAX language.
- Data Source Overload: Every user interacting with your report is hammering your source database with queries. This can slow down the database for everyone else, including a company’s operational systems. It can be a serious problem for heavily-used reports.
- Power Query Restrictions: While you can still perform some transformations in the Power Query Editor with a DirectQuery source, some of the more advanced options are unavailable. Import mode gives you the full, unrestricted data-shaping capabilities of Power Query.
Moving to Import mode copies the data into your .pbix file, which resolves all these issues. Performance becomes lightning-fast, you get access to all DAX and Power Query features, and you stop putting constant strain on your source database. The tradeoff is that your data is only as fresh as your last scheduled refresh, and your file size will increase.
Your Pre-Flight Checklist: A Few Things to Do First
Before you make the switch, a little preparation can save you a big headache. Run through this quick checklist:
1. Back Up Your Report
This is non-negotiable. Before making any significant changes to your data model, save a copy of your .pbix file with a new name, like MyReport_v2_before_import.pbix. If anything goes wrong, you'll have a clean version to revert to in seconds.
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.
2. Understand the Implications
- File Size: Switching to Import mode will pull all your data into the .pbix file. Make a quick assessment of your data volume. A few hundred thousand rows are fine, but if you're pulling in hundreds of millions, your file size could become unmanageable. Look at your capacity limits (Pro vs. Premium) to make sure you won't hit a wall.
- Data Freshness: Say goodbye to real-time data. Once you switch to Import, your data is static until you hit the "Refresh" button in Power BI Desktop or set up a scheduled refresh in the Power BI Service. Make sure your business stakeholders are aware of this change.
3. Check Your Data Sources
The process of switching from DirectQuery to Import is generally smooth, but it's a good idea to confirm you still have the necessary credentials and permissions for the data source. You'll need them to perform the initial data import refresh.
Step-by-Step Guide: How to Change Storage Mode to Import
Ready to make the change? The process itself happens in the Model View of Power BI Desktop. Here’s a detailed, step-by-step breakdown.
Step 1: Open Power BI Desktop and Go to Model View
First, open the .pbix file you want to edit. On the left-hand side of the Power BI window, you'll see three icons for Report, Data, and Model views. Click on the Model view icon (it looks like three connected boxes).
In the Model view, you’ll see your data tables and the relationships between them. Tables connected using DirectQuery typically have a solid blue bar across the top.
Step 2: Select the Table You Want to Change
Click on the table you want to switch from DirectQuery to Import. This will highlight the table and bring up its properties in the Properties pane on the right-hand side of the screen.
If you don't see the Properties pane, go to the "View" tab in the top ribbon and make sure "Properties" is checked.
Step 3: Change the Storage Mode in the Properties Pane
With your table selected, look for the Advanced section in the Properties pane. In this section, you'll see a setting called Storage mode. It will currently be set to "DirectQuery."
Click the dropdown menu and select Import.
Step 4: Confirm the Change
After you select "Import," Power BI will display a warning message. It explains that changing to Import is an irreversible action (which is why you made a backup!), will make the table invisible while data loads, and may require a manual refresh. Click OK to proceed.
Step 5: Repeat for Other Tables (or Change Them All at Once)
If you have multiple tables using DirectQuery, you'll need to repeat this process for each one. However, if several tables come from the same source, you can change them in bulk. Hold down the Ctrl key and click on each of the tables you want to switch. With all of them selected, go to the Properties pane and change the Storage mode to Import. This will apply the change to all selected tables simultaneously.
Note: You can only change the Storage Mode in bulk if the tables are from a source that supports both Import and DirectQuery. If you have a mix, you'll need to do them one by one.
Step 6: Refresh your Data a Final Time
Once you’ve switched all your desired tables to Import, you need to pull the data into your model. Return to the Report view (the first icon on the left). In the "Home" tab on the ribbon, click the Refresh button. Power BI will now connect to your source and import the data for all tables set to Import mode. After the refresh is complete, your dashboard will be faster and all your DAX functions will be available.
What About Mixed Mode? It's the Best of Both Worlds
You don't have to choose between only DirectQuery or only Import. Power BI also supports a "Mixed" mode, where some tables in your model are set to Import and others remain as DirectQuery. This is an advanced technique, but it’s incredibly powerful for optimizing large reports.
A common setup is to use Import mode for smaller "dimension" tables (like Products, Customers, or Calendar tables) and keep the massive "fact" table (like Sales Transactions or Web Logs) on DirectQuery.
This gives you:
- Fast Slicers and Filters: Filtering by product or date is snappy because those dimension tables are in memory (Import).
- Real-Time Sales Data: The values and aggregations in your charts are always up-to-date because they are queried directly from the huge sales transaction table (DirectQuery).
To use this, simply follow the steps above but only switch your dimension tables to Import, leaving the large fact table as DirectQuery. This balanced approach provides both performance and data freshness.
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.
Common Problems & How to Fix Them
Sometimes things don’t go as planned. Here are some common roadblocks you might face and how to get past them.
"The Storage mode dropdown menu is greyed out!"
This is an annoying but common issue, and it can usually be traced back to one of a few things:
- The data source only supports one mode. Some connectors (like a basic file import) can only be set to Import and cannot be placed on DirectQuery and therefore will be greyed out.
- There may be existing calculated tables that reference the DirectQuery table (as a calculated table must originate from a cached/imported source). You may need to remove those calculated tables first and add them back after you've changed the storage mode.
"My Report is Still Slow After Switching."
If you switched to Import and performance is still lagging, the problem might be your data model itself, not the connection mode. Before importing, it's wise to use the Power Query Editor to:
- Remove unused columns: Each extra column adds to the memory footprint. If you don't need it for a visual or a calculation, get rid of it.
- Reduce cardinality: Columns with lots of unique values (like transaction IDs or timestamps with milliseconds) are memory hogs. If you don’t need that level of detail, consider rounding timestamps or removing high-cardinality IDs.
"I'm Getting an Error During the Data Refresh."
If the refresh fails after you switch to Import, the most likely culprit is an issue with your data source credentials.
- Go to File > Options and settings > Data source settings.
- Find your data source in the list and click Edit Permissions to re-enter your username/password or re-authenticate your credentials.
Final Thoughts
Switching your Power BI report from DirectQuery to Import mode is a simple change that can dramatically improve dashboard performance and unlock the full analytical power of DAX. By following the steps in the Model view, you can gain complete control over your report’s behavior and find the right balance between real-time data and user experience.
While mastering connection types in BI tools is powerful, it also highlights how much time can sink into setup and configuration. We built Graphed because we believe getting insights shouldn't require you to be a technical expert. With our platform, you connect your data sources like Google Analytics, Shopify, or Salesforce in a few clicks, and then simply ask for the reports and dashboards you need in plain English. There’s no more worrying about storage modes or query performance - just real-time, automated reporting that lets you focus on growing your business.
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.