Tutorial: Visualize data with Power BI
In this tutorial, you learn how to create a Power BI workspace, link your Azure Synapse workspace, and create a Power BI data set that utilizes data in your Azure Synapse workspace.
Prerequisites
To complete this tutorial, install Power BI Desktop.
Overview
From the NYC Taxi data, we created aggregated datasets in two tables:
- nyctaxi.passengercountstats
- SQLDB1.dbo.PassengerCountStats
You can link a Power BI workspace to your Azure Synapse workspace. This capability allows you to easily get data into your Power BI workspace. You can edit your Power BI reports directly in your Azure Synapse workspace.
Create a Power BI workspace
- Sign in to powerbi.microsoft.com.
- Select Workspaces, then select Create a workspace. Create a new Power BI workspace named NYCTaxiWorkspace1 or similar, since this name must be unique.
Link your Azure Synapse workspace to your new Power BI workspace
In Synapse Studio, go to Manage > Linked Services.
Select New > Connect to Power BI.
Set Name to NYCTaxiWorkspace1 or similar.
Set Workspace name to the Power BI workspace you created earlier, similar to NYCTaxiWorkspace1.
Tip
If the workspace name doesn't load, select Edit and then enter your workspace ID. You can find the ID in the URL for the PowerBI workspace:
https://msit.powerbi.com/groups/<workspace id>/
Select Create.
Publish to create the linked service.
Create a Power BI dataset that uses data in your Azure Synapse workspace
- In Synapse Studio, go to Develop > Power BI. (If you don't see Power BI, refresh the page.)
- Go to NYCTaxiWorkspace1 > Power BI datasets and select New Power BI dataset. Select Start.
- Select the SQLPOOL1 data source, select Continue.
- Select Download to download the
.pbids
file for yourNYCTaxiWorkspace1SQLPOOL1.pbids
file. Select Continue. - Open the downloaded
.pbids
file. Power BI Desktop opens and automatically connects to SQLDB1 in your Azure Synapse workspace. - If you see a dialog box appear called SQL Server database:
- Select Microsoft account.
- Select Sign in and sign in to your account.
- Select Connect.
- After the Navigator dialog box opens, check the PassengerCountStats table and select Load.
- After the Connection settings dialog box appears, select DirectQuery > OK.
- Select the Report button on the left side.
- Under Visualizations, select to the line chart icon to add a Line chart to your report.
- Under Fields, drag the
PassengerCount
column to Visualizations > Axis. - Drag the
SumTripDistance
andAvgTripDistance
columns to Visualizations > Values.
- Under Fields, drag the
- On the Home tab, select Publish.
- Select Save to save your changes.
- Choose the file name
PassengerAnalysis.pbix
, and then select Save. - In the Publish to Power BI window, under Select a destination, choose your
NYCTaxiWorkspace1
, and then select Select. - Wait for publishing to finish.
Configure authentication for your dataset
- Open powerbi.microsoft.com and Sign in.
- On the left side, under Workspaces, select the NYCTaxiWorkspace1 workspace.
- Inside that workspace, locate a dataset called Passenger Analysis and a report called Passenger Analysis.
- Hover over the PassengerAnalysis dataset, select the ellipsis (...) button, and then select Settings.
- In Data source credentials, select Edit, set the Authentication method to OAuth2, and then select Sign in.
Edit a report in Synapse Studio
- Go back to Synapse Studio and select Close and refresh.
- Go to the Develop hub.
- To the right of the Power BI layer, ellipsis (...) button, and select Refresh to refresh the Power BI reports node.
- Under Power BI you should see:
- In NYCTaxiWorkspace1 > Power BI datasets, a new dataset called PassengerAnalysis.
- Under NYCTaxiWorkspace1 > Power BI reports, a new report called PassengerAnalysis.
- Select the PassengerAnalysis report. The report opens and you can edit it directly within Synapse Studio.