Connecting to PostgreSQL Database in Power BI Desktop

Posted on by By Ramu Vudugula, in Services | 1

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.

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

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:

Power BI Desktop

powerbi

  1. Here we will connect to postgresql database
  2. In the above image, we can see we have search box, search “Postgres” and it will give postgresql database connector

  3. Select the postgresql database connector and click on Connect. Unfortunately we are getting the error as below image
  4. postgresql powerbi

  5. Click on Learn More and it will open the below link
  6. Releases

  7. Install the latest version of the Npgsql and restart the machine. This will not resolve the error.
  8. Make data easy with Helical Insight.
    Helical Insight is the world’s best open source business intelligence tool.

    Grab The 30 Days Free Trail

  9. To resolve this, we have an alternative solution to connect PostgreSQL database i.e. using “ODBC” generic database connector.
  10. Using the below link download the latest version of ODBC connection for PostgreSQL database and Install
  11. Latest Version of ODBC

  12. After installation completed, open the Power BI Desktop and choose Get Data
  13. Instead of selecting postgresql database, this time we will choose ODBC. Select ODBC and click on Connect
  14. A window will open and select “None” as Datasource Name (DSN)
  15. 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
  16. datasource

  17. To get the proper connection string use this link.
  18. PostgreSQL ODBC Driver

  19. We have given the below connection string and able to click on “OK”
  20. Connection String: 
    Driver={PostgreSQL ANSI(x64)}; Server=localhost; Port=5433; Database=foodmart
    
  21. Then it will open a window to enter the credentials
  22. ODBC Driver

  23. Enter the username and password and click on connect
  24. Now it will open a window with list of tables available in the selected database.
  25. Make data easy with Helical Insight.
    Helical Insight is the world’s best open source business intelligence tool.

    Divers

  26. Choose the table whatever you need and play with data.

In case if you have any queries please get us at support@helicaltech.com

Thank You
Ramu Vudugula
BI Developer
Helical IT Solutions Pvt Ltd

logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

0 0 votes
Article Rating
Subscribe
Notify of
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Thanks Ram, this helped me. Especially the connection string was not working for me before. I had to append ‘ANSI’ into the driver string to make it work.