Power BI supports multiple data sources like Excel, CSV files, Azure, etc.
Here we will see how to connect Azure SQL Database in Power BI desktop application.
Steps to do in Power BI desktop Application below,
- Open Power BI desktop application.
- Click on Get Data on the Top of the Menu Options and click on More… as highlighted below,
- Then select Azure and in right side you will see first option which is Azure SQL database.
- Click on Connect.
Give Azure SQL Server Name from the Azure Portal like below,
- Database Name is optional but if you want to give you can give the database name along with the Server name like below –
- The same Database Name has been used here which you gave at the time of the creation of Azure Database Service in Azure from Azure portal.
In my case, it is Azure Database Name – powerbitestDb
- Let's say you don’t give Database Name which is optional, you gave only Server Name then click on Ok button.
- It will ask Database base authentication type
- From which authentication type you want to login into Database.
- In case of Azure SQL Database, you always have to Choose second option that is database, and give Username and Password which will be your SQL Server authentication type.
- Once you give username and password click on Connect
- Now you will be able to see your database name along with all the tables in that Database.
- Select the tables from which you want to create a power bi report.
- Let's say I will take two tables here – Sales.LT.Customer and Sales.LT.Product.
- Click on Load.
- This is how both the tables are now imported into your Power BI report which you can see in the right section (Fields column) in the Power BI Desktop application.
- Now select a chart from the Visualization section, let's say a pie chart.
- Select Rows/Column from the tables from the (Fields) Area from your choice which you wish to plot of the chart like below,
So, I took Company Name from Sales LT Customer and another column from another table Say productId from Sales LT product.
And this is how the Pie chart looks,
- Save this chart with a meaningful name. This will save as .pbix file in your system.
Summary
This is how we can use Azure SQL Database in our Power BI reports.