Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

ashishrj

Configuring Power BI Connectivity to PostgreSQL Database

Prerequisites:

Power BI Desktop, PostgreSQL Database, pgAdmin III, Visual Studio 2008 or higher

 

Introduction

 

Power BI supports connectivity to different databases such as SQL Server, MySQL, Oracle and many more (list of all supported databases given here ). By providing necessary details such as server name, database name, username & password, you can easily connect to database and start exploring data using different visualizations in the form of reports/dashboards.

 

This article will walk you through the necessary steps required to configure in your system before establishing connection of Power BI Desktop Tool to PostgreSQL Database.

After installation of PostgreSQL database in your machine, if you try connecting Power BI Desktop Tool to PostgreSQL Database, you will get following error as shown in the screenshot below:

 

 1.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Following are the steps required to connect Power BI Desktop Tool to PostgreSQL Database:

 

  1. Setup PostgreSQL Client
  2. Connect Power BI Desktop Tool to PostgreSQL

Below are the steps that will walk you through setting up PostgreSQL Client:

 

Step 1: Download the latest MSI from this page and install it in your machine.

 

Step 2: Once this is done, you can now try connecting Power BI to PostgreSQL. However you will notice below error

 

2.png 

 

Once you restart your machine, you can now connect to PostgreSQL and start playing with your data. Below are the steps for connecting Power BI Desktop Tool to PostgreSQL:

 

Step 1: Open pgAdmin III interface to create database, table and few records to display in your report as shown in screen capture below

 

 6.png

 

Step 2: Open Power BI Desktop Tool and click ‘Get Data’ and select PostgreSQL Database as shown below

 

Step 3: Enter server name (in our case it is localhost), database name, username and password as shown in below screen capture

 

 

 4.png

 

Step 4: Select required table from database and click load as shown in screen capture below

 

5.png 

 

Step 5: Once data is loaded in model, you can start playing around with the data and create beautiful visualizations/reports as shown in image below and later publish it to Power BI Online Service

Comments

Ok. Resolvido

Consegui resolver seguindo esse post aqui 

http://leandrobenitez.com.br/blog/conectando-power-bi-no-sql-server/#comment-5000

Informei a porta no servidor separado por ':'

Anonymous

Hi Ashishrj

I have a bug after step 3.

I wrote "localhost5432" and "Collaborateurs" (Database : Name of my table, created in Postgresql)

The answer is :

"Connection not possible" 

"An error occurred while reading provider data: ' unknown host '" 

 

How can I edit my database in PowerBi Desktop ?

 

Connecting to Power BI desktop is not as hard...but impossible to connect to AWS PostGreSQL with Power BI service... maddening 😞 

AssemblyError.pngIf you have a 4.1.1 version of npgsql installed and run into could not load assembly System.Runtime.CompilerServices.Unsafe. Downgrade to npgsql 4.0.10 to get unblocked.

Olá, ao conectar no Postgree SQL, quando eu escolho qualquer tabela para importar no BI, apresenta o erro 

em anexo. Como resolvo isso?

 

IMG-20200403-WA0034.jpg

 
 
 

Does anyone know why the onboard PostgreSQL connector doesn't work with PostgreSQL databases on AWS? 

Hello, my conecction works at desktop level, but when I upload it to Power BI Web it does not work. I tried to configure it here:

AGUS_0-1620065029206.png

AGUS_1-1620065044789.png

 

but I can´t do it. This mesage appears:

 

AGUS_2-1620065149381.png

 

Can you please help me?

Thank you.

 

 

I think it might be due not having a gateway installed...

I have a gateway an it works fine with my MySQL connections but it doesn't work with Postgres

I have imported DB from my Postgres SQL into the Power Bi Desktop version.

I want to check all the relations, keys and joins existing for one table in a diagrammatic format with all the mappings with other tables or schemas.

 

For example:

Table A has a primary key, but can be a foreign key in another table with any sort of mapping (one-to-one, one-to-many, so on).

 

My requirement is that I want to see mappings or connections between all the tables in my DB (with multiple schemas) in the form of a diagram. The functional or logical mappings of all respective tables.

 

Please help.

 

 

 

what if i want to upload pgadmin4 database into power bi web interface? how to do it?

I think it would be helpful to include at least a link to the MS page that gives the IP addresses that power platform uses so that they can be added to the Config file for Postgre to allow connection from PBi web.

 

Also, opening the ports in the gateway is also necessary.