How to Connect SQL Server to Power BI
12 Aug 2026 · 4 min read
Use the built-in SQL Server connector in Power BI, then choose Import for speed and rich modelling or DirectQuery for near-live data on large or governed datasets. On-premises servers need the data gateway for scheduled refresh.
Power BI ships with a native SQL Server connector, so connecting is straightforward; the real decision is how you connect. Import mode pulls a compressed copy of the data into Power BI for fast, flexible analysis, while DirectQuery leaves the data in SQL Server and queries it live. For on-premises or private-network servers you also need the on-premises data gateway to enable scheduled refresh or live queries from the Power BI service. Getting these choices right is the difference between a snappy, trustworthy report and a slow one that frustrates users.
Connecting in three steps
In Power BI Desktop, choose Get Data, select SQL Server, and enter the server and database names. Pick a connectivity mode (Import or DirectQuery), authenticate with Windows or SQL credentials, and select the tables or write a query. For the published report to refresh, configure the gateway and data source credentials in the Power BI service. Prefer connecting to views or stored procedures over raw tables so the source can evolve without breaking your model.
Import vs DirectQuery
This is the choice that defines your report. Import loads data into Power BI's in-memory engine, giving the fastest interaction, the full DAX feature set and offline modelling. The trade-offs are dataset size limits and data only being as fresh as the last refresh. DirectQuery keeps data in SQL Server, so reports are near-live and there is no large import, but every visual interaction issues a query, performance depends on the source, and some DAX and modelling features are restricted.
| Factor | Import | DirectQuery |
|---|---|---|
| Data freshness | As of last refresh | Near-live |
| Performance | Fast (in-memory) | Depends on source and indexing |
| Dataset size | Bounded by capacity limits | Suited to very large data |
| DAX and modelling | Full feature set | Some restrictions |
| Best for | Most reports | Live data, large or governed datasets |
A pragmatic middle ground is a composite model: import the dimensions and small fact tables, use DirectQuery for the largest fact, and add aggregations so common queries hit the imported summary first.
The data gateway
If SQL Server runs on-premises or in a private network, install the on-premises data gateway on a reliable machine close to the database, register it in the Power BI service and map your dataset to it. Use the standard (enterprise) gateway, not personal mode, for shared workloads. Azure SQL Database reached over a public endpoint does not need a gateway, though private-endpoint configurations may. Keep the gateway patched and monitored: a stalled gateway is a common cause of silent refresh failures.
Best practice for performance and security
- Push work to the source. Filter, aggregate and shape in SQL views rather than dragging entire tables into Power Query.
- Model with a star schema. Separate facts and dimensions and add a proper date table; this helps both Import and DirectQuery.
- Index for DirectQuery. Ensure the columns used in joins and filters are indexed, and review the queries Power BI generates.
- Use least-privilege credentials. Connect with a read-only account scoped to the needed objects, and apply row-level security where users should see different slices.
- Mind refresh limits. A Pro workspace allows up to eight refreshes a day and Premium or Fabric up to 48; schedule them outside peak source load.
- Use parameters. Parameterise the server and database so you can promote a report from development to production without rebuilding it.
When to bring in a warehouse
If multiple reports query the same operational SQL Server, or queries compete with the live application, stage data into a reporting database or warehouse and point Power BI there instead. This isolates reporting load, lets you model cleanly and supports history that the operational system may not retain. It is also the right foundation if you later blend SQL Server with cloud sources or want a governed Power BI estate.
As a rough UK guide, a scoped dashboard build starts from £6,000 with typical projects at £8,000–£14,000, and senior Power BI day rates run roughly £400–£850/day (as of 2026, confirm current pricing). The biggest wins usually come from modelling and source-side tuning, not licence upgrades.
A Trusted Numbers Review reviews your SQL Server connection, model and gateway, then recommends the Import, DirectQuery or hybrid approach that fits your data. Book one to turn your database into decisions you can trust.
Frequently asked questions
Should I use Import or DirectQuery for SQL Server?
Use Import for most cases; it is faster and supports the full DAX and modelling feature set. Use DirectQuery when data must be near-live, the dataset is too large to import, or governance requires it to stay in the source.
Do I need a gateway to connect SQL Server to Power BI?
Yes, if the server is on-premises or in a private network and you want scheduled refresh or DirectQuery from the Power BI service. Azure SQL Database accessed over public endpoints does not need a gateway.
Why is my DirectQuery report slow?
DirectQuery sends a query to SQL Server for every visual interaction, so performance depends on indexing, the data model and source load. Reduce visuals per page, add indexes, and consider aggregations or a hybrid model.
Should I report straight from our production SQL Server or a copy?
A few light Import refreshes off production are usually fine, but heavy DirectQuery or many reports can compete with the live application and slow it down. If reporting load grows or you need history the source does not keep, stage the data into a separate reporting database or warehouse.
Want SQL Server in Power BI, refreshed every morning, with the numbers agreeing?
This guide gets the connection working. The Trusted Numbers Review goes the rest of the way: SQL Server joined to your finance and sales data in one model, refresh that runs itself, and a fixed price to build it. Two weeks, £2,000–£4,000, credited to the build.
Related guides
How to Connect Snowflake to Power BI
Connect Snowflake to Power BI using Import or DirectQuery. Set up the gateway and authentication, and keep Snowflake compute costs down.
21 May 2026 · 4 min read
How to Connect BigQuery to Power BI
Connect BigQuery to Power BI using Import or DirectQuery. Covers the native connector, the GA4 export angle and how to keep BigQuery query costs down.
10 Jun 2026 · 4 min read
Connect Sage to Power BI: Methods and Gotchas
A practical guide to connecting Sage 50, Sage 200 and Sage Intacct to Power BI, covering the methods, the finance KPIs worth modelling and the common gotchas.
20 Jun 2026 · 4 min read
Connect Klaviyo to Power BI: Methods & KPIs
A practical guide to connecting Klaviyo to Power BI, covering the API, connectors and warehouse builds, plus the email and retention KPIs that matter.
18 Jun 2026 · 4 min read
Connect Meta (Facebook) Ads to Power BI
A practical guide to connecting Meta (Facebook) Ads to Power BI, covering the methods, paid-social ROAS KPIs and how to blend ad data with GA4 and orders.
16 Jun 2026 · 4 min read
Amazon Seller & Vendor Central to Power BI
Connect Amazon Seller Central and Vendor Central to Power BI: choose the reports, separate ad data and check marketplace totals before sharing a dashboard.
14 Jun 2026 · 6 min read
Related solutions
Power BI consultancy for your next business decision
Power BI consultancy for sales and finance reporting. See a working example, review pricing and scope your dashboard build with UK-based remote delivery.
SSRS to Power BI Migration (UK)
Migrate SQL Server Reporting Services (SSRS) to Power BI. We move paginated reports and rebuild interactive dashboards on a governed model. Fixed scope.
Power BI Rescue (UK)
Bought Power BI and don't trust the numbers? We fix the report you have: find why the figures are wrong, reconcile to source, hand it back. Fixed price.