Visualizing in PowerBI Desktop
Exercise 6: Visualizing in Power BI Desktop
Duration: 20 mins
Synopsis: In this exercise, you will create a Power BI Report to visualize the data in HDInsight Spark.
Task 1: Connect to the Lab VM
-
NOTE: If you are already, connected to your Lab VM, skip to Task 2.
-
From the left side menu in the Azure portal, click on Resource groups, then enter your resource group name into the filter box, and select it from the list.
-
Next, select your lab virtual machine from the list.
-
On your Lab VM blade, select Connect from the top menu.
-
Download and open the RDP file.
-
Select Connect, and enter the following credentials:
- User name: demouser
- Password: Password.1!!
Task 2: Connect to HDInsight Spark using Power BI Desktop
-
On your Lab VM, launch Power BI Desktop by double-clicking on the desktop shortcut you created in the pre-lab setup.
-
When Power BI Desktop opens, you will need to enter your personal information, or Sign in if you already have an account.
-
Select Get data on the screen that is displayed next.
-
Select Azure from the left, and select Azure HDInsight Spark (Beta) from the list of available data sources.
-
Select Connect.
-
You will receive a prompt warning you that the Spark connector is still in preview. Select Continue.
-
On the next screen, you will be prompted for your HDInsight Spark cluster URL.
-
To find your Spark cluster URL, go into the Azure portal, and navigate to your Spark cluster, as you did in Exercise 5, Task 1. Once on the cluster blade, look for the URL under the Essentials section
-
Copy the URL, and paste it into the Server box on the Power BI Azure HDInsight Spark dialog.
-
Select DirectQuery for the Data Connectivity mode, and select OK.
-
Enter your credentials on the next screen as follows.
- User name: demouser
- Password: Password.1!!
-
Select Connect.
-
In the Navigator dialog, check the box next to flightdelayssummary, and select Load.
-
It will take several minutes for the data to load into the Power BI Desktop client.
Task 3: Create Power BI report
-
Once the data finishes loading, you will see the fields appear on the far right of the Power BI Desktop client window.
-
From the Visualizations area, next to Fields, select the Globe icon to add a Map visualization to the report design surface.
-
With the Map visualization still selected, drag the OriginLatLong field to the Location field under Visualizations.
-
Next, drag the NumDelays field to the Size field under Visualizations.
-
You should now see a map that looks similar to the following (resize and zoom on your map if necessary):
-
Unselect the Map visualization by clicking on the white space next to the map in the report area.
-
From the Visualizations area, select the Stacked Column Chart icon to add a bar chart visual to the report’s design surface.
-
With the Stacked Column Chart still selected, drag the Day field and drop it into the Axis field located under Visualizations.
-
Next, drag the AvgDelayProbability field over, and drop it into the Value field.
-
Grab the corner of the new Stacked Column Chart visual on the report design surface, and drag it out to make it as wide as the bottom of your report design surface. It should look something like the following.
-
Unselect the Stacked Column Chart visual by clicking on the white space next to the map on the design surface.
-
From the Visualizations area, select the Treemap icon to add this visualization to the report.
-
With the Treemap visualization selected, drag the OriginAirportCode field into the Group field under Visualizations.
-
Next, drag the NumDelays field over, and drop it into the Values field.
-
Grab the corner of the Treemap visual on the report design surface, and expand it to fill the area between the map and the right edge of the design surface. The report should now look similar to the following.
-
You can cross filter any of the visualizations on the report by clicking on one of the other visuals within the report, as shown below. (This may take a few seconds to change, as the data is loaded.)
-
You can save the report, by clicking Save from the File menu, and entering a name and location for the file.