• Querying Your Data
  • Visualization Tools
  • Power BI Integration

Power BI Integration

This page describes how to setup Microsoft Power BI and configure it for use with Rockset.

#Setup

Setting up a Power BI reporting instance on-premise can be done using the Power BI Report Server, and can be accessed using Power BI Desktop or Power BI Mobile. Microsoft's website has excellent documentation on each of these approaches, and downloads for each of their Power BI products can be found here.

#Configuration

To configure Rockset with Power BI, we will need to create a Query Lambda use the Rockset Python SDK to create a Python script in Power BI:

  1. Create an API Key using the Rockset Console under Manage > API Keys.

Create New API Key

  1. Create a Query Lambda in Rockset with the data you would like to visualize using Power BI.

Create New Query Lambda

  1. Next, we will create a Python script in Power BI with your Rockset Query Lambda:

    • Set up the Power BI Python integration by following the instructions here.
    • Install the Rockset Python SDK by following instructions here.
    • Prepare a Python script using the Power BI Python integration and the Rockset Python SDK by following the instructions here, using the results from your Query Lambda execution response as the input data.
    • Save your newly created Python script and import the data into Power BI

Using our example from above, your Python script might look something like this:

import pandas as pd
from rockset import Client, ParamDict

rs = Client(
   api_key='K49fTyOKuh78w50BBke5zQcmMANHOJjkRyB9UrA3Go7mOmnIV3FYG3hGVcr5Pj9u4',
   api_server='https://api.rs2.usw2.rockset.com'
)

query_lambda = rs.QueryLambda.retrieve(
   'movie_stats',
   version='7dacafad6f84c575',
   workspace='samples'
)

params = ParamDict()
response = query_lambda.execute(parameters=params)
df = pd.DataFrame(data=response['results'])
print(df)

#Usage

To visualize your Rockset data inside Power BI, you can simply create a Power BI visual using the Python script we created above by following the instructions here to create the visualization of your choice.

You may also run the Python script directly in Power BI by following the instructions here.

Join us on Slack!
Building on Rockset? Come chat with us!