Two hours wasted, so writing in full.
Download and install postgresql ODBC driver
Goto below URL
URL: https://www.postgresql.org/ftp/odbc/versions/msi/
Scroll down
Click on a zip file to download (i took psqlodbc_12_00_0000-x64.zip)
Unzip file
Run the .MSI file
Take all defaults given and install it
Create ODBC data source
Find the ODBC data source using below (I took "ODBC Data Sources (64-bit)"):
Windows > Start button > search for "ODBC Data Sources"
User DSN > PostgreSQL ANSI(x64) > Finish
Give details
Data source name : PostgreSQL30 ###
DB name *** , server, port, username, pwd
SSL mode = disabled (default)
click on Test button
"Connection successful" message will come, else re-check details above.
We now have a new User DS, with PostgreSQL30 created
Download Power BI
Windows > Start button > Microsoft Store
Search for "Power BI Desktop" > Get/Install
Source: https://docs.microsoft.com/en-us/power-bi/desktop-get-the-desktop#download-power-bi-desktop
Running the Power BI
Get Data (On the left)
Search for "odbc" > Select "ODBC" on right pane > Connect
DSN > PostgreSQL30 ( --- this is same as above ### --- )
OK
"Navigator" dialog is shown, with "Display Options"
ODBC ... PostgreSQL30
> DB name ( --- this is same as above *** --- )
Open the > button on left of DB name
select the tables
click "Load" button
Done.
You have successfully connected Power BI (PBI) to your postgres or other database.
Hope this helps.