ETLMCPData Conveyance Works
Log in Start free
Guides

Connect Power BI (and Excel) to the etlmcp PostgreSQL table

How to point Power BI Desktop, Excel or Power Query Online at the table etlmcp loads: the Npgsql driver, encryption, timeouts, gateways and column types.

Power BI reads the etlmcp table through its built-in PostgreSQL connector: in Power BI Desktop choose PostgreSQL database, give the server and the database, pick Import or DirectQuery, sign in with a database user, and select your table in the Navigator. You install nothing on a current Desktop, because the driver ships with it. The same connector is in Excel and in Power Query Online, so the steps below apply there too, with the differences noted.

The driver: Npgsql 4.0.17, and nothing newer

The connector talks to PostgreSQL through the Npgsql provider. Microsoft's connector page says Power BI Desktop has bundled Npgsql since December 2019, and that from the October 2024 release the bundled version is 4.0.17. Npgsql 4.1 and later do not work with the connector, because of .NET incompatibilities.

  • On a Desktop older than December 2019 you must install Npgsql 4.0.17 yourself, choosing the GAC installation option and the same 32-bit or 64-bit build as Power BI.
  • A separate Npgsql installed in the GAC overrides the bundled one. If the connector fails, check whether another tool installed a different Npgsql on the machine.

Import or DirectQuery

The connector offers both modes for Power BI semantic models. Import copies the rows into the model and refreshes on a schedule; DirectQuery sends each visual's query to your database.

etlmcp replaces a pipeline's date range inside one transaction: it deletes that pipeline's rows for the range, inserts the new ones and commits once. A refresh or a DirectQuery visual therefore sees either the old rows or the new ones, never a half-loaded range. Import is usually the lighter choice for a marketing table, since a daily sync changes the data once a day and the model then answers every click without touching your server.

Encryption and certificates

If Power BI Desktop cannot encrypt the connection, it warns you and asks before it connects without encryption. For an encrypted connection, your PostgreSQL server must be configured for SSL, and the machine running Power BI may need the server's certificate installed among its Trusted Root Certification Authorities.

In Power Query Online the switch is Use Encrypted Connection; clear it only when the server has no SSL.

etlmcp itself always loads over SSL, so a server that accepts etlmcp's loads already has SSL turned on. The certificate trust on the Power BI machine is still a separate step.

Command timeout

A query that runs longer than 10 minutes fails by default. In Desktop's advanced options you can set Command timeout in minutes to a larger value. Microsoft notes this option exists only in Power Query Desktop.

Publishing to the Power BI service

The service needs its own route to the database: a cloud connection, a virtual network data gateway, or an on-premises data gateway. Since the June 2025 gateway release, the on-premises gateway bundles Npgsql as Desktop does; an older gateway needs Npgsql 4.0.17 installed on the gateway machine. For which addresses to allow in your firewall, see IP addresses for BI tools.

Connect with a user that can only read, not the user etlmcp writes with. A read-only PostgreSQL role shows how to grant one that also sees tables created later.

What the columns arrive as

etlmcp sets each column's type when it creates the column, and never changes it later. The common columns get these types:

Column PostgreSQL type
date date
impressions, clicks, cost, conversions, conversion_value, ctr, cpc, cpm, cpa double precision
network, account_id, account_name, the campaign, ad group and ad ids and names, currency text
_etlmcp_pipeline_id text

Because date is a true PostgreSQL date column rather than text, you can mark it as the model's date column and build a date hierarchy on it without a conversion step.

Do not sum ctr, cpc, cpm or cpa: each row holds that row's ratio. Divide summed figures instead, such as total cost over total clicks for CPC.

Extra columns and native SQL

Platform-specific figures land in columns whose names start with extra., such as extra.revenue. PostgreSQL keeps the dot in the name, so in the SQL statement advanced option you must wrap these names in double quotes. A name longer than PostgreSQL's 63-byte identifier limit is shortened by etlmcp, with a short hash added to keep it unique.

SELECT date, campaign_name, cost, "extra.revenue"
FROM public.ad_performance
WHERE date >= DATE '2026-01-01'

Here public.ad_performance stands for the schema and table you gave the destination. In the Navigator, without SQL, the columns appear with their dots and need no quoting. For the destination's settings, see the PostgreSQL destination.

Related

Sources

  1. Power Query PostgreSQL connector — learn.microsoft.com, checked