Connecting to PostgreSQL Database in Power BI Desktop

Ramu Vudugula
2 min readAug 30, 2019

Microsoft Power BI Desktop is a business intelligence tool which can be used to connect to any type data source I.e either a file or from a database, transform and visualize the data.

In Power BI Desktop, we can connect to data from many different sources. To connect to data, select Get Data from the Home. Select the down arrow, or the Get Data text on the button, it shows the most common data types and on clicking on more it will open a window with all the data types available in Power BI Desktop. See the below images:

  1. Here we will connect to postgresql database
  2. Select the postgresql database connector and click on Connect. Unfortunately we are getting the error as below image
  3. Click on Learn More and it will open the below link
  4. Install the latest version of the Npgsql and restart the machine. This will not resolve the error.
  5. To resolve this, we have an alternative solution to connect PostgreSQL database i.e. using “ODBC” generic database connector.
  6. Using the below link download the latest version of ODBC connection for PostgreSQL database and Install
  7. After installation completed, open the Power BI Desktop and choose Get Data
  8. Instead of selecting postgresql database, this time we will choose ODBC. Select ODBC and click on Connect
  9. A window will open and select “None” as Datasource Name (DSN)
  10. In the same window, we have connection string. Here we have to provide proper connection details to connect postgresql database. We won’t be able to click “OK” until we have provided the correct connection string. See the below image
  11. To get the proper connection string use this link.
  12. We have given the below connection string and able to click on “OK”
Connection String: Driver={PostgreSQL ANSI(x64)}; Server=localhost; Port=5433; Database=foodmart
  1. Then it will open a window to enter the credentials
  2. Enter the username and password and click on connect
  3. Now it will open a window with list of tables available in the selected database.
  4. Choose the table whatever you need and play with data.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Ramu Vudugula
Ramu Vudugula

Written by Ramu Vudugula

Engineer… Learning to move from B to A with Intelligence

No responses yet