- Applications and Dashboards
- Visualization Tools
Power BI Integration
This page describes how to setup Microsoft Power BI and configure it for use with Rockset.
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.
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:
- Create an API Key using the Rockset Console under
Manage > API Keys.
- Create a Query Lambda in Rockset with the data you would like to visualize using Power BI.
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)
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.