Power BI Table Not in Import Mode
In this article
You cannot manually change a table’s mode from DirectQuery to Import or vice versa; Power BI automatically determines the mode based on the data source and connection settings. To force a table into Import mode, you must disconnect it from the DirectQuery source and create a new Import connection or use a copy of the data. This guide explains why this happens and how to force a table into Import mode to meet reporting or performance needs.
What You'll Need
- A Power BI Desktop or Service account with permissions to create and modify data models.
- Access to the source data (SQL Server, Azure SQL, Excel, etc.) used by the DirectQuery table.
- Administrative rights on the machine if working in Power BI Desktop (for data source configuration).
Step-by-Step
- Identify the DirectQuery Tables in Your Model. Open your Power BI Desktop file. Go to the Home tab and select Manage Data Models. In the Model view, look at the Data Source column for each table. If the data source type is listed as DirectQuery (SQL Server, Oracle, etc.), that table is in DirectQuery mode and cannot be switched manually.
- Disconnect the DirectQuery Table from the Model. In the same Manage Data Models dialog, select the DirectQuery table you wish to convert. Click the Disconnect button. This action removes the table from the model but does not delete the data from the source. The table is now effectively removed from your report’s data context.
- Refresh or Reconnect as Import. Return to the Report view or the Data view. Right-click on the table you just disconnected and select Refresh. If the table is still linked to a source that supports Import (such as a local SQL Server or an Excel file), the refresh will attempt to load the data into the Power BI model in Import mode. If the source is an online-only service that only supports DirectQuery, the refresh will fail, confirming that the mode cannot be changed for that specific source.
- Create a New Import Table Using Data Flows or Queries. If the original source only supports DirectQuery, you must create a copy in Import mode. Go to the Home tab and select New Table. In the Power Query editor that opens, you can create a duplicate query of the DirectQuery table. However, because the original query is a DirectQuery query, the copy will also be DirectQuery. To force Import, you must modify the M code for the new query to append
Source = Sql.Database(..., "false")or use a gateway to pull the data into a local cache, which is the standard method for creating an Import replica of a DirectQuery source. - Use a Data Flow to Create an Import Replica. For a cleaner approach, create a Data Flow in Power BI Service. Define a query in the Data Flow that targets the same source but uses a gateway to pull the data into the Gateway’s cache. Once the data is cached, create a new dataset in your report that connects to this Data Flow. The tables created from this Data Flow will be in Import mode, allowing you to report on them without impacting the live DirectQuery connection.
- Verify the New Table's Mode. After refreshing or creating the new table, return to the Manage Data Models dialog. Check the Data Source column again. It should now read Import or the name of the local source. The table is now in Import mode and will be fully calculated locally on your machine or in the service.
Common Mistakes
Assuming that a table can be toggled directly. Users often look for a switch like "Switch to Import" and are confused when it does not exist. The mode is a property of the data connection, not a user-editable setting. Attempting to delete and recreate the table in the same query pane will not work; the new table will inherit the DirectQuery setting of the original query if it is based on the same source connection.
Tips
When creating a replica in Import mode, be mindful of the data size. Importing large datasets can slow down your report performance. Use data filtering or aggregation queries in Power Query before bringing the data into the model to reduce the size of the Import table.
Troubleshooting
If you cannot disconnect the table, ensure you are in the correct view. The Manage Data Models dialog is only accessible from the Desktop application. In Power BI Service, you can only remove tables or change the connection type from the gateway configuration, which is a more advanced task.
If the refresh fails after disconnecting, the source database may not be accessible from your local machine or the gateway. Check your data source credentials and ensure the SQL Server or database allows connections from your IP address or the gateway server.
Frequently Asked Questions
Can I change a table from DirectQuery to Import in the Power BI Service?
No. The Power BI Service does not allow you to alter the mode of an existing table. You must use Power BI Desktop to disconnect the table and reconnect it as Import, or use a Data Flow to create a new Import replica.
What happens to my DirectQuery tables if I delete the model?
Deleting the model removes all tables and relationships. If you want to keep the data, you must use the disconnect feature, which removes the table from the model but preserves the underlying data connection for potential reconnection.
Does using a gateway automatically convert DirectQuery to Import?
No. A gateway is used to optimize DirectQuery performance by caching data locally. It does not change the fundamental DirectQuery mode of the table. To get Import mode, you must create a separate dataset or data flow that pulls data into the gateway’s cache.
Can I merge a DirectQuery table and an Import table in the same model?
Yes. Power BI allows you to mix DirectQuery and Import tables. However, be aware that calculations involving both types will execute in DirectQuery mode, which can be slower than if all tables were in Import mode.
Why is my DirectQuery table still showing as DirectQuery after I think I switched it?
Check the Data Source column in the Manage Data Models dialog. If the source is an online service that only supports DirectQuery (like many cloud data warehouses), the table will remain DirectQuery regardless of your attempts to force an Import connection.