How to Load Data from SQL Server into Power BI – Step by Step Guide
Introduction
Power BI is a wonderful data visualization tool that allows you to create reports and charts easily. By connecting Power BI to SQL Server, one can present robust reports using the data on the server. The easy steps in this guide will show you how to connect Power BI to SQL Server.
Why Connect SQL Server to Power BI?
Before making any steps ahead, let us define the benefits of using SQL Server and Power BI:
1. Live direct database connection - Obtain live data directly from SQL server.
2. Automation of data refreshing - Automatically refresh reports without user input.
3. Efficient querying-skillful uses of SQL queries for data management handling.
4. Good scalability-a good deal of performance overhead is not going to come in the way of scalability when working with large sets of data.
5. Good compatibility-It performs well with all other Microsoft tools: Excel, Azure, and PowerApps.
Step 1: Preparing SQL Server for Power BI Connection
1.1 Install and Configure SQL Server
Find out whether you have SQL Server installed on your system.if not, download it from the official Microsoft website and install it.
•First, install SQL Server Management Studio (SSMS) for a convenient working environment for handling your database.
•Make a test database or use an existing one.
•Make sure you have access permission for the database.
1.2 Enable Remote Connections
By default, SQL Server allows only local connections. For remote connections:
1. Launch the SQL Server Configuration Manager;
2. Proceed to SQL Server Network Configuration and select Protocols for [Instance Name].
3. TCP/IP protocol should be enabled.
4. The service SQL Server should be restarted.
1.3 Find Your SQL Server Details
The following are needed to connect Power BI to SQL Server:
• Server name - found in SSMS Connect to Server.
• Database name - the specific database name that contains your data.
• Authentication mode - either Windows authentication or SQL Server authentication.
• Credentials - username and password if you selected SQL authentication.
Step 2:Connecting Power BI to SQL Server
2.1 Open Power BI Desktop
• Open Power BI Desktop on your machine.
• Under Home, click on Get Data.
2.2 Select SQL Server as the Data Provider
• In the Get Data window, search for SQL Server.
• Click on SQL Server Database and then Connect.
2.3 Fill in SQL Server Information
• Server: Fill in the name of your SQL Server.
• Database: Fill in the name of the database (or leave the box empty to view all databases).
• Data Connectivity Mode:
o Import Mode: Loads data into Power BI for better performance.
o DirectQuery Mode: Keeps data live and fetches the latest updates directly from SQL Server.
• After that click on OK.
2.4 Authentication
• Select Windows Authentication or SQL Server Authentication.
• Provide the credentials if necessary.
• Click Connect.