1. Connecting to a Database

Subtitles Enabled

Sign up for a free trial to access more free content.

Free trial

Advanced Data Connections

10 lessons , 2 exercises

Preview Course


Databases are common in most businesses, but connecting to them can be more difficult than connecting to simple files. In this lesson, we’ll learn how to connect to a PostGreSQL database hosted online.


  1. Course Outline (00:03)

    Many Power BI courses focus on connecting simple data sources like Excel files to Power BI. This course demonstrates how to connect to more advanced data sources. This course contains two main sections: 

    1. Connecting to a database and working with associated data

    2. Connecting Excel directly to Power BI, using Analyze in Excel, and setting up scheduled refreshes

  2. Lesson Goal (00:45)

    The goal of this lesson is to connect to a database that contains information related to UK pharmaceutical data.

  3. Connecting to a Database (01:02)

    Power BI Desktop can connect to a wide variety of database types, using the Get Data option. To connect to a database, you need to provide certain information. For example, connecting to a PostgreSQL database, you need to provide the server where the database is found, and the name of the database.

    Many databases give you the option to import the data or use DirectQuery. If you use Import, Power BI creates a copy of the database, and stores that copy in the workbook. This copy is then used when you want to create charts and visualizations. You need to manually refresh the connection to update the data stored in the workbook. If you use DirectQuery, Power BI creates a direct connection between the workbook and the database. Power BI queries the database directly any time we use its data in a visualization.

    The main advantage of DirectQuery is that data is updated any time you update a visualization. The main disadvantage is that frequently querying a database can be slow, especially if the database is large.

    In our case, we connect to a database stored locally in a Microsoft Access file. After connecting to this database, the navigator window will display a list of all the tables in the database. You can preview a table by selecting it from this list. Generally, a database contains many tables, and you’ll want to select only a small number of them to analyze.


Advanced Data Connections


My Notes

You can take notes as you view lessons.

Sign in or start a free trial to avail of this feature.

Free Trial

Download our training resources while you learn.

Sign in or start a free trial to avail of this feature.

Free Trial