2 Dec’15

BIPower BI Connectivity to PostgreSQL


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


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:



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

Steps to set up PostgreSQL Client:

Step 1: Download and unzip the Npgsql package from the link mentioned here

You will find two DLL files named as Npgsql.dll and Mono.Security.dll as shown in screen capture below:



Step 2: You need to have Visual Studio 2008 or later. Open visual studio command prompt using administrative rights as shown in the screen capture below:



Step 3: Locate and Open machine.config from the location given below:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config \machine.config 

.Net framework and Npgsql version might vary depending on the version of installation. Add the following below <DbProviderFactories> tag:

<add name="Npgsql Data Provider" invariant="Npgsql" description=".Net Framework Data Provider for PostgreSQL Server" type="Npgsql.NpgsqlFactory, Npgsql, Version=, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7"/>

Find the screenshot given below for this step:



Step 4: Now in your visual studio command prompt, use the following command to successfully move DLL files to C:\windows\assembly

gacutil -I "C:\Users\ajagd_000\Downloads\Npgsql2.0.1-bin-ms.net3.5sp1\Npgsql2.0.1-bin-ms.net3.5sp1\bin\Npgsql.dll"

Where C:\Users\ajagd_000\Downloads is the file location for the Npgsql package downloaded.

Similar command you can run for Mono.Security.dll file

gacutil -I "C:\Users\ajagd_000\Downloads\Npgsql2.0.1-bin-ms.net3.5sp1\Npgsql2.0.1-bin-ms.net3.5sp1\bin\Mono.Security.dll"

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



Once you restart your machine, you can now connect to PostgreSQL and start playing with your data.

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



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



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



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.



Written by

Team Member


One thought on “Power BI Connectivity to PostgreSQL”

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Dynamics 365 Client Diagnostics

    15 March’ 2018

    Main cause of Performance Issues: Bandwidth and latency are the primary characteristics which affects the performance o...

    Read more
  • Closing Blind Shift in MPOS and CPOS in Dynamics 365 for Retail

    15 March’ 2018

    Manual For closing Blind shift in POS: Blind shifts terminate the currently ongoing shift and when logged in a new shif...

    Read more
  • Persistent Filters in the Power BI Service

    13 March’ 2018

    Introduction: The feature is finally release, and it is power BI has announced general availability of persistent filt...

    Read more
  • Cause and Solution for Scribe MSMQ not receiving Message from AX

    10 March’ 2018

    Issue: Microsoft Message Queuing (MSMQ) service running on Server might be unable to receive messages. Therefore, messa...

    Read more
  • User Privileges on SharePoint – D365 Document Integration

    10 March’ 2018

    Overview: Often, we wonder what could be wrong where we see a generic error on Documents in Dynamics 365. Something lik...

    Read more