Ready to get started?

Download a free trial of the Amazon Athena Power BI Connector to get started:

 Download Now

Learn more:

Amazon Athena Icon Amazon Athena Power BI Connector

The fastest and easiest way to connect Power BI to Amazon Athena data. Includes comprehensive high-performance data access, real-time integration, extensive metadata discovery, and robust SQL-92 support.

Visualize Live Amazon Athena Data of Power BI Report Builder in Power BI Service



Use CData Power BI Connectors to connect to live Amazon Athena data using Power BI Report Builder and create custom reports in the Power BI Service through the On-Premises Gateway.

CData Power BI Connectors provide self-service integration with Microsoft Power BI. The CData Power BI Connector for Amazon Athena links your Power BI reports to real-time Amazon Athena data. You can monitor Amazon Athena data through dashboards and ensure that your analysis reflects Amazon Athena data in real time by scheduling refreshes or refreshing on demand. This article details how to use the Power BI Connector to create real-time visualizations of Amazon Athena data in Microsoft Power BI Desktop.

Create and Configure a DSN

Installing the Power BI Connector creates a DSN (data source name) with the name CData PBI Amazon Athena that Power BI uses to connect to the data source. Configure the DSN by filling in the required connection properties.

You can use the Microsoft ODBC Data Source Administrator to create a new DSN or configure (and rename) an existing DSN. From the Start menu, enter "ODBC Data Sources." Ensure that you run the version of the ODBC Administrator that corresponds to the bitness of your Power BI Desktop installation (32-bit or 64-bit).

Authenticating to Amazon Athena

To authorize Amazon Athena requests, provide the credentials for an administrator account or for an IAM user with custom permissions: Set AccessKey to the access key Id. Set SecretKey to the secret access key.

Note: Though you can connect as the AWS account administrator, it is recommended to use IAM user credentials to access AWS services.

Obtaining the Access Key

To obtain the credentials for an IAM user, follow the steps below:

  1. Sign into the IAM console.
  2. In the navigation pane, select Users.
  3. To create or manage the access keys for a user, select the user and then select the Security Credentials tab.

To obtain the credentials for your AWS root account, follow the steps below:

  1. Sign into the AWS Management console with the credentials for your root account.
  2. Select your account name or number and select My Security Credentials in the menu that is displayed.
  3. Click Continue to Security Credentials and expand the Access Keys section to manage or create root account access keys.

Authenticating from an EC2 Instance

If you are using the CData Data Provider for Amazon Athena 2018 from an EC2 Instance and have an IAM Role assigned to the instance, you can use the IAM Role to authenticate. To do so, set UseEC2Roles to true and leave AccessKey and SecretKey empty. The CData Data Provider for Amazon Athena 2018 will automatically obtain your IAM Role credentials and authenticate with them.

Authenticating as an AWS Role

In many situations it may be preferable to use an IAM role for authentication instead of the direct security credentials of an AWS root user. An AWS role may be used instead by specifying the RoleARN. This will cause the CData Data Provider for Amazon Athena 2018 to attempt to retrieve credentials for the specified role. If you are connecting to AWS (instead of already being connected such as on an EC2 instance), you must additionally specify the AccessKey and SecretKey of an IAM user to assume the role for. Roles may not be used when specifying the AccessKey and SecretKey of an AWS root user.

Authenticating with MFA

For users and roles that require Multi-factor Authentication, specify the MFASerialNumber and MFAToken connection properties. This will cause the CData Data Provider for Amazon Athena 2018 to submit the MFA credentials in a request to retrieve temporary authentication credentials. Note that the duration of the temporary credentials may be controlled via the TemporaryTokenDuration (default 3600 seconds).

Connecting to Amazon Athena

In addition to the AccessKey and SecretKey properties, specify Database, S3StagingDirectory and Region. Set Region to the region where your Amazon Athena data is hosted. Set S3StagingDirectory to a folder in S3 where you would like to store the results of queries.

If Database is not set in the connection, the data provider connects to the default database set in Amazon Athena.

Create an ODBC DSN Connection.

Get Amazon Athena Data

With the data source configured, follow the steps below to load data from Amazon Athena tables into a dataset.

Select Tables and Views to Load

  1. Open the Power BI Report Builder and choose Blank Report. Choose Blank Report in Power BI Report Builder.
  2. Click On Data Sources -> Add Data Source. Add a Data Source.
  3. Choose Connection Type as ODBC and click on "Build." Build an ODBC connection
  4. Click on "Use user or system data source name" and select CData PBI Amazon Athena Sys. Choose CData Power BI connector for the datasource.
  5. Click on Test Connection in Connection Properties and make sure it is successful. Test the ODBC connection.
  6. Click Test Connection in the Data Source Properties Window and click on OK. Test the data source connection before adding it.
  7. With the Data Source configured, you can configure the DataSets. Click on DataSets -> Add Dataset. Choose the Data Source you recently configured and click on Query Designer. Choose the datasource.
  8. Write an SQL Command for the table you wish to generate a report on and click "Run" (!). You can find the table names from the Metadata Tab in the CData Connection Manager in DSN. Open query designer and run the SQL command.
  9. Click on "Validate Query." You will see the Column names on the left-hand side of the window. Now, you can generate any report according to your use case. Data source column names displayed after successful validation

Create Data Visualizations

After loading Amazon Athena data into Power BI Report Builder, you can create data visualizations in the Report view by dragging fields from the Fields pane onto the canvas. Follow the steps below to create a chart:

  1. Navigate to Insert -> Chart -> Insert Chart -> Select Chart Type and click OK.
  2. Select Values, Category Groups, and Series Groups. You can apply filters to the page, report, or to a single visualization by dragging fields onto the Filters pane. To filter on the field value, select one of the values displayed in the Filters pane. Apply filter to create the report structure

Configure Data Refresh on PowerBI.com

Follow the steps below to configure automatic data refresh through the Power BI Gateway. The gateway enables the Power BI cloud service to connect to the DSN on your machine.

Selecting a Gateway Mode

You need to select a gateway mode when you install the gateway:

  • Gateway (personal mode): Use the gateway in personal mode if you only need to publish to PowerBI.com and refresh reports. The gateway runs under your Windows user account.
  • Gateway (formerly Enterprise): Use the default gateway if you use other Azure services requiring a gateway. You also need the default gateway if multiple users need to access the gateway. You need a system DSN to connect through the default gateway. (System DSNs can be accessed system-wide, while user DSNs are restricted to a specific user account.) You can use the CData Power BI Salesforce system DSN configured as the last step of the connector installation.

Configuring the Gateway (Personal Mode)

Publishing through the gateway in personal mode requires an installed gateway with access to custom connectors.

  1. Run the CData Power BI Connector installer. Download the Power BI Gateway (Personal Mode) if you have not already done so.
  2. Select the on-premises data gateway (personal mode) option.
  3. Sign in to the gateway.
  4. In the Connectors section of the gateway settings, enable the "custom data connectors" option. You can also specify an alternate path to the custom data connector .pqx files here.

    Note: The CData Power BI Connectors install the .pqx files to the default folder. Path: "Your User Home\Documents\Power BI Desktop\Custom Connectors."

Configuring the Gateway (Standard Mode)

Publishing through the gateway requires an installed gateway with access to customer connectors and a configured connection to the DSN for Salesforce from PowerBI.com.

Set Up the Gateway

Follow the steps below to configure the gateway on your machine:

  1. Run the CData Power BI Connector installer. If you have not already done so, download the Power BI Gateway (Standard Mode).
  2. Select the on-premises data gateway (recommended) option.
  3. Sign into the gateway.
  4. Name the gateway and specify a recovery key.
  5. In the Connectors section, choose a folder where the gateway will look for the CData Power BI Connector. This article uses "C:\Users\PBIEgwService\Documents\Power BI Desktop\Custom Connectors\". Alternatively, copy the .pqx files of the CData Connectors (found in "C:\Users\USERNAME\Documents\Power BI Desktop\Custom Connectors\") to the folder you configured.

    Note: The account configured for the service (NT SERVICE\PBIEgwService) must be able to access the folder chosen for the gateway. If needed, you can change the service account in the Service Settings section of the gateway installer.

  6. Confirm that the entry CData.AmazonAthena is in the list in the Connectors section. List of CData Power BI connectors.

Connect to Salesforce Data from PowerBI.com

  1. Add a data source to the gateway: Log into PowerBI.com and from the Settings menu, select Manage Gateways and select your gateway.
  2. Select "Allow user's custom data connectors to refresh through this gateway cluster."
  3. Click Apply to save your changes.
  4. Click the option to add a data source to the gateway.
  5. In the Data Source Settings section, enter a name for the data source. In the Data Source Type menu, select CData Power BI Connector for Amazon Athena.
  6. In the Data Source Name box, enter the system DSN: CData PBI Amazon Athena Sys.

Publish to PowerBI.com

You can now publish refreshable reports and their underlying datasets. Follow the steps below to publish and complete the data refresh configuration for a dataset.

  1. In Power BI Desktop Report Builder, click "Publish" on the Home ribbon to publish the report.
  2. On PowerBI.com, select the workspace where the report is uploaded and provide a file name. Report file name.
  3. Click on "Open Amazon Athena in Power BI" to open the report in the Power BI Service in your browser. Final published report.

Error Encountered and Solution

If you get an error message like "Unable to render paginated report," then you can follow the instructions below to resolve the error.

Unable to render paginated report.

Create a Data Source in the Power BI Service

  1. Click on "Update data source credentials". Update data source credentials.
  2. Click on "Continue". Paginated report successfully uploaded.
  3. In the Gateway Connection section, enable the option to use a gateway and select your gateway. You may need to add the data source to the gateway manually:
    1. Expand the Gateway under the Actions column.
    2. Click the link to "Manually add to gateway." Manually add to gateway properties.
  4. Click on Add to gateway (refer to the screenshot below). Choose Basic as Authentication because Anonymous Authentication is not supported. Provide the username and password for the Power BI Service Account. Enter authentication details.
  5. After the Data Source is successfully created, select the Connection name in "Maps to" and apply the changes. Map to the data source connection.
  6. Go to Power BI Report Builder and click "Open Amazon Athena in Power BI". You can now see the created report in the Power BI Service (Online).

At this point, you will have a Power BI report built on top of live Amazon Athena data using Power BI Report Builder and CData Power BI connectors. Learn more about the CData Power BI Connectors for Amazon Athena and download a free trial from the CData Power BI Connector for Amazon Athena page. Let our Support Team know if you have any questions.