Data Connectivity mode

Next, you can select your Data Connectivity mode. In the PostgreSQL database dialog, select Import followed by OK to display a list of all available tables, or select DirectQuery to query the data source directly without importing or copying data directly into Power BI.

To learn more about the Import mode, please read the section on importing a table. To learn more about DirectQuery mode, please read the section on querying a dataset without importing data.

Select OK after confirming your database details.

Authentication

After confirming your data connectivity mode, a prompt asking for your username, password, and application settings appears. The username in this case is your Organization ID and the password is your authentication token. Both can be found on the Query Service credentials page.

Fill in these details, then select Connect to continue to the next step.

Import a table

By selecting the Import Data Connectivity mode, the full dataset is imported which allows you to use the selected tables and columns within the Power BI desktop application as-is.

IMPORTANT
To see data changes that have occurred since the initial import, you must refresh the data within Power BI by importing the full dataset again.

To import a table, enter the server and database details as described above and select the Import Data Connectivity mode, followed by OK. The Navigator dialog appears, displaying a list of all the available tables. Select the table you want to preview, followed by Load to bring the dataset into Power BI. The table is now imported into Power BI.

General information on connecting to data in the PowerBi desktop app can be found in the official documentation.

Import tables using custom SQL

Power BI and other third-party tools like Tableau do not currently allow users to import nested objects, such as XDM objects in Platform. To account for this, Power BI allows you to use custom SQL to access these nested fields and create a flattened view of the data. Power BI then loads this flattened view of the previously nested data as a normal table.

From the PostgreSQL database dialog, select Advanced options to enter a custom SQL query in the SQL statement section. This custom query should be used to flatten your JSON name-value pairs into a table format. The official documentation also provides information on how to connect PowerBI using an SQL statement in the advanced options.

After you have entered your customized query, select OK to continue with connecting your database. See the authentication section above for guidance on connecting a database from this part of the workflow.

Once authentication is complete, a preview of the flattened data appears in the Power BI Desktop dashboard as a table. The server and database name are listed at the top of the dialog. Select Load to complete the import process.

The visualizations are now available for editing and exporting from the Power BI Desktop app.

Query the dataset without importing data

The DirectQuery Data Connectivity mode queries the data source directly without importing or copying data into the Power BI Desktop. Using this connection mode, you can refresh all visualizations with current data through the UI. However, the time required to produce or refresh the visualization will vary depending on the performance of the underlying data source.

More information on the use of DirectQuery as well as a comprehensive discussion about its connectivity options, use cases, and limitations can be found in the official PowerBI documentation.

To use this Data Connectivity mode, select the DirectQuery toggle then Advanced options to enter a custom SQL query in the SQL statement section. Ensure that Include relationship columns is selected. Once you have completed your query, select OK to continue.

A preview of your query appears. Select Load to see the results of the query.