Import Data From SQL Server Into Power BI

Introduction

 
In this article you will learn to import data from SQL Server. If you are a beginner, here I am giving you a brief introduction about SQL Server. SQL Server is relational database management system or you can say a software to store data and retrieve data used by other applications.
 
Here I am giving you a link to download a dummy database. You need to connect your database in SQL Server.
 
https://docs.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sql-server-ver15&tabs=tsql
 
From the above link you can download the OLTP data. There are so many database samples of “AdventureWorks”.
 
In this article I am going to use “AdventureWorks2014.bak” to access data and create a report in Power BI. 
 
Once you go through this article you will be able to use any database and get data into Power BI to create reports and dashboards.
 
See the below steps to try to connect your data from SQL Server.
 
Step 1
 
Go to the Home page of the Power Bi Desktop and click on ‘Get Data’ and select ‘SQL Server Database’ and then click on ‘Connect’.
 
Import Data From SQL Server Into Power BI
 
After clicking on ‘Connect’, you need to give the database details like ‘Server name’ and database credentials, then click on ‘Ok’.
 
Import Data From SQL Server Into Power BI
 
Now your database ‘AdventureWorks2014.bak’ has connected with this tool.
 
Import Data From SQL Server Into Power BI
 
Step 2
 
Double click on “AdventureWorks2014”, now you will be able to see all the table of this database. Select any one from those tables by clicking on check box and clicking on ‘Load’ to load table.
 
Here I am selecting ‘Product.Location” table.
 
Import Data From SQL Server Into Power BI
 
After clicking on ‘Load’, connection settings will appear. Check ‘Import’ and click.
 
Import Data From SQL Server Into Power BI
 
Now your table has imported in the Power BI desktop tool successfully. You can see the fields in the left side of the tool.
 
Import Data From SQL Server Into Power BI
 
Step 3
 
To create the first report I am using ‘Clustered column chart’ visualization by using ‘CostRate’ and ‘Name’ fields
 
Import Data From SQL Server Into Power BI
 
In the second report I am using ‘Area chart’ with ‘CostRate’ and ’Name’ fields.
 
Import Data From SQL Server Into Power BI
 
To create the  third report, use ‘Donut chart’ visualization with ‘CostRate’ and ‘LocationId’ fields.
 
Import Data From SQL Server Into Power BI
 
In the  last two reports I used ‘Card’ visualization which is showing total ‘CostRate’ and total ‘Availability’.
 
Import Data From SQL Server Into Power BI
 
Similarly, you can use any table from that database and different visualizations to create reports.
 

Conclusion

 
I hope this article will help you to understand how to connect your Power BI desktop with sql server, import table and create report. In the next article you will learn more about Power BI reports using sql sever table. Thanks for reading this article.


Similar Articles