Introduction
Being able to connect your Power BI to a database should not be complicated. Connecting Power BI directly to a PostgreSQL database offers several advantages. It eliminates repetitive manual imports, improves data consistency, supports larger datasets, and allows reports to be refreshed whenever data changes.
In this post, i will be explaining a step by step guide of how to Connect Power BI to an Aiven PostgreSQL database using SSL, with DBeaver helping us verify the connection first.
Part 1. Connect Power BI to a Local PostgreSQL Server
Step 1: Create Your PostgreSQL Database
Install PostgreSQL and create your database.
Open DBeaver and connect using:
Host: localhost
Port: 5432
Database: postgres
Username: postgres
Password: Your PostgreSQL password
Step 2: Import Your Dataset
Once connected:
Expand Schemas.
Open the public schema.
Right-click and select Import Data.
Choose your CSV or Excel dataset.
Complete the import wizard.
Your tables should now appear inside the PostgreSQL database.
Step 3: Open Power BI Desktop
Open Power BI Desktop.
Step 4: Select PostgreSQL Server
Go to:
Home → Get Data → PostgreSQL Server → Connect

Step 3 — Enter the connection details
Server: localhost (default port 5432)
Database: your database name Leave the connectivity mode as Import and click OK
Part 2: Connecting Power BI to Cloud-Based PostgreSQL Using Aiven
Cloud databases provide scalable and secure database solutions without requiring users to manage physical database infrastructure.
Aiven PostgreSQL is used as the cloud database platform.
Creating an Aiven PostgreSQL Database
An Aiven PostgreSQL service was created to host the dataset.
Aiven provided the required connection information:
Host address
Port number
Database name
Username
Password
SSL certificates
Step 1: Download the SSL Certificate
Cloud databases encrypt communication between your computer and the server.
Download the CA Certificate (ca.pem) from the Aiven dashboard.
Step 2: Import the Certificate into Windows
Search for:
Manage Computer Certificates
Navigate to:
Trusted Root Certification Authorities → Certificates
Right-click Certificates and select:
All Tasks → Import
Choose the downloaded ca.pem file and complete the Certificate Import Wizard.
Windows will confirm the import was successful.
In this dialogue box, navigate to Trusted Root Certification Authorities and click on the drop-down arrow, then right click on Certificates, then go to All Tasks, then Import. You will select the certificate downloaded from aiven, follow the procedure and you will receive a certificate import wizard stating it was successful
Connecting to your power BI
The process is more or less the same with the local Postgres SQL. Your connection details are in your Aiven postgres SQL service.The server box details are (hostname:port) while the rest of the details are input directly.

_
Load your tables_
Because Windows now trusts the Aiven certificate, the SSL handshake succeeds and the navigator opens with your tables. Select what you need and click Load or Transform Data.
In conclusion, connecting Power BI to PostgreSQL is straightforward. Local databases connect with localhost and standard credentials; Aiven adds one trust step, then behaves the same. From there you can model your tables, write DAX, and build dashboards that always reflect the latest data.







Top comments (0)