Following are the steps to connect SQL Server in Power BI:
-
Open Power BI Desktop
-
From the Home ribbon, click Get Data → Select SQL Server from the data source list.
-
In the dialog box, enter the following details:
-
SQL Server Name (e.g., ServerNameInstance or just ServerName).
-
Database Name
-
Choose the Data Connectivity mode:
-
Import (loads data into Power BI)
-
DirectQuery (queries data live from SQL Server)
Note- This example is for Windows Credentials. If you are using SQL Authentication then you need to enter SQL Server UserName & Password to connect to database
Write Query for a table.
-
Click Ok then you will see data from the table
-
Click Load to load the data directly.
-
Power BI will also show a navigator that lists available tables and views. We can pick any table or view to see & load the data