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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
pedrocardo
Frequent Visitor

Power BI Service and Google Cloud SQL

I have a PostgreSQL database hosted on Google Cloud SQL.

 

I'd like to create dashboards in Power BI Service to visualize this data.

 

Is it possible to establish a direct connection between Power BI Service and my PostgreSQL database without using a data gateway?

1 ACCEPTED SOLUTION
Shravan133
Super User
Super User

Yes, you can establish a direct connection between Power BI Service and your PostgreSQL database hosted on Google Cloud SQL, but there are some important considerations:

Direct Query to PostgreSQL

  1. Direct Connection via On-Premises Data Gateway:

    • While Power BI Service can connect to PostgreSQL, it typically requires the use of an On-Premises Data Gateway for data refreshes and live connections. This is because the connection is often routed through the gateway for security and management reasons.
    • If you're looking to avoid a gateway, you might need to rely on the data being available in a service that Power BI can connect to directly, like a cloud-based SQL database supported natively by Power BI.
  2. Cloud-based Connections:

    • Power BI Premium: With Power BI Premium, you have the option to connect to PostgreSQL directly using a DirectQuery connection if your PostgreSQL instance is accessible over the internet and is not behind a firewall that would prevent Power BI from reaching it. Ensure that your PostgreSQL instance has public IP access and that appropriate firewall rules are in place to allow Power BI's IP addresses.
    • Public IP and Firewalls: Make sure your PostgreSQL instance has a public IP address and that the necessary firewall rules are configured to allow traffic from Power BI's IP ranges. You'll need to allow incoming connections from Power BI's service IP ranges, which can be found in Microsoft's documentation.
  3. Steps to Connect:

    • Set Up the Connection:
      1. In Power BI Desktop: Go to Home > Get Data > More > Database > PostgreSQL. Enter your PostgreSQL server details, database name, and credentials.
      2. Configure DirectQuery: When setting up the connection, choose the DirectQuery option if you want real-time querying of your PostgreSQL database.
    • Publish to Power BI Service:
      • Publish your Power BI Desktop report to Power BI Service.
      • In Power BI Service, go to your dataset settings and ensure that the dataset is set up to use DirectQuery mode.
  4. Firewall and Security Considerations:

    • Security: Ensure that any data transmitted between Power BI and PostgreSQL is encrypted and that your PostgreSQL instance is securely configured.
    • Network Configuration: Configure your PostgreSQL instance to allow connections from Power BI Service. This may involve updating firewall rules or network configurations to permit the necessary traffic.

View solution in original post

3 REPLIES 3
prakashsingh29
New Member

How to connect GCP Cloud SQL (Postgresql) with PowerBI if my PostgreSQL instance is not public and have only the private IP?

Anonymous
Not applicable

Hello,@Shravan133 ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.
Hi,@pedrocardo I am glad to help you.
According to your description, you want to connect the power bi service to the data source without using a gateway connection.
As @suggests, you can use a cloud connection to connect to a data source in the cloud to achieve the same effect as a local gateway
like this:

vjtianmsft_0-1722582035153.png

vjtianmsft_1-1722582043951.png

You can choose the appropriate data connection method according to your actual data source needs, using cloud connection or using local data gateway, the important thing is to configure the options correctly, make sure the firewall and port number are set correctly, to realize the normal connection of data!


Below are some articles and official documents I found, hope it helps you!
URL:

[solved] Connecting PowerBI Cloud to PostgreSQL | Flowpoint
Connecting PostgreSQL to Power BI in 3 Best ways | Hevo (hevodata.com)
Power Query PostgreSQL connector - Power Query | Microsoft Learn

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Shravan133
Super User
Super User

Yes, you can establish a direct connection between Power BI Service and your PostgreSQL database hosted on Google Cloud SQL, but there are some important considerations:

Direct Query to PostgreSQL

  1. Direct Connection via On-Premises Data Gateway:

    • While Power BI Service can connect to PostgreSQL, it typically requires the use of an On-Premises Data Gateway for data refreshes and live connections. This is because the connection is often routed through the gateway for security and management reasons.
    • If you're looking to avoid a gateway, you might need to rely on the data being available in a service that Power BI can connect to directly, like a cloud-based SQL database supported natively by Power BI.
  2. Cloud-based Connections:

    • Power BI Premium: With Power BI Premium, you have the option to connect to PostgreSQL directly using a DirectQuery connection if your PostgreSQL instance is accessible over the internet and is not behind a firewall that would prevent Power BI from reaching it. Ensure that your PostgreSQL instance has public IP access and that appropriate firewall rules are in place to allow Power BI's IP addresses.
    • Public IP and Firewalls: Make sure your PostgreSQL instance has a public IP address and that the necessary firewall rules are configured to allow traffic from Power BI's IP ranges. You'll need to allow incoming connections from Power BI's service IP ranges, which can be found in Microsoft's documentation.
  3. Steps to Connect:

    • Set Up the Connection:
      1. In Power BI Desktop: Go to Home > Get Data > More > Database > PostgreSQL. Enter your PostgreSQL server details, database name, and credentials.
      2. Configure DirectQuery: When setting up the connection, choose the DirectQuery option if you want real-time querying of your PostgreSQL database.
    • Publish to Power BI Service:
      • Publish your Power BI Desktop report to Power BI Service.
      • In Power BI Service, go to your dataset settings and ensure that the dataset is set up to use DirectQuery mode.
  4. Firewall and Security Considerations:

    • Security: Ensure that any data transmitted between Power BI and PostgreSQL is encrypted and that your PostgreSQL instance is securely configured.
    • Network Configuration: Configure your PostgreSQL instance to allow connections from Power BI Service. This may involve updating firewall rules or network configurations to permit the necessary traffic.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.