Power Bi Lab Manual
Power Bi Lab Manual
(AUTONOMOUS)
R22 Regulation
Batch: 2022-2026
Academic Year:2024-2025
List of Experiments:
Exercise 1: Import the legacy data from different data sources such as
(Excel, SqlServer, Oracle etc.) and load in the target system.
Exercise 2: Perform the Extraction Transformation and Loading
(ETL) process to construct the database in the Sql
server / Power BI.
Exercise 3: Data Visualization from ETL Process
Exercise 4: Creating a Cube in SQL server 2012
Exercise 5: Apply the what – if Analysis for data visualization. Design
and generate necessary reports based on the data
warehouse data.
Exercise 6: Using the Data Modeling and Navigation
Exercise 7: Creating the Dash Boards
Exercise 8: Develop power BI application with various operations in
Dashboard designer
Exercise 9: Develop a power BI application with Geographical Maps
Exercise 10: Using the Power BI to create geocoding on maps and
visualize spatial distributions.
Exercise 11: Create an interactive exploration of maps using Power BI
Exercise 12: Develop power BI application with MongoDB.
2
Experiment -1
2) From the Home ribbon, select Get Data. Excel is one of the Most Common data
connections, so you can select it directly from the Get Data menu.
3) If you select the Get Data button directly, you can also select FIle > Excel and select
Connect.
5) In the Navigator pane, select the Products table and then select Edit.
3
Importing Data from OData Feed
In this task, you'll bring in order data. This step represents connecting to a sales system. You
import data into Power BI Desktop from the sample Northwind OData feed at the following
URL, which you can copy (and then paste) in the steps below:
http://services.odata.org/V3/Northwind/Northwind.svc/
Connect to an OData feed:
1) From the Home ribbon tab in Query Editor, select Get Data.
3) In the OData Feed dialog box, paste the URL for the Northwind OData feed.
4) Select OK.
5) In the Navigator pane, select the Orders table, and then select Edit.
4
Note - You can click a table name, without selecting the checkbox, to see a preview.
5
Exercise -2
Aim : Perform the Extraction Transformation and Loading
(ETL) process to construct the database in the Sqlserver /
Power BI.
Source code:
Step 1 : Data Extraction :
The data extraction is first step of ETL. There are 2 Types of Data Extraction
1. Full Extraction : All the data from source systems or operational systems gets extracted to
staging area. (Initial Load)
2. Partial Extraction : Sometimes we get notification from the source system to update
specific date. It is called as Delta load.
Source System Performance: The Extraction strategies should not affect source system
performance.
The data transformation is second step.After extracting the data there is big need to do the
transformation as per the target system.I would like to give you some bullet points of
Data Transformation.
6
Step 3 : Data Loading
Data loading phase loads the prepared data from staging tables to main tables.
Step 1 − Open either BIDS\SSDT based on the version from the Microsoft SQL Server
programs group. The following screen appears.
Step 2 − The above screen shows SSDT has opened. Go to file at the top left corner in the
above image and click New. Select project and the following screen opens.
7
Step 3 − Select Integration Services under Business Intelligence on the top left corner in the
above screen to get the following screen.
Step 4 − In the above screen, select either Integration Services Project or Integration Services
Import Project Wizard based on your requirement to develop\create the package.
Modes
There are two modes − Native Mode (SQL Server Mode) and Share Point Mode.
Models
There are two models − Tabular Model (For Team and Personal Analysis) and Multi
Dimensions Model (For Corporate Analysis).
8
The BIDS (Business Intelligence Studio till 2008 R2) and SSDT (SQL Server Data Tools
from 2012) are environments to work with SSAS.
Step 1 − Open either BIDS\SSDT based on the version from the Microsoft SQL Server
programs group. The following screen will appear.
Step 2 − The above screen shows SSDT has opened. Go to file on the top left corner in the
above image and click New. Select project and the following screen opens.
Step 3 − Select Analysis Services in the above screen under Business Intelligence as seen on
the top left corner. The following screen pops up.
9
Step 4 − In the above screen, select any one option from the listed five options based on your
requirement to work with Analysis services.
In this step you remove all columns except ProductID, ProductName, UnitsInStock, and
QuantityPerUnit
Power BI Desktop includes Query Editor, which is where you shape and transform your data
connections. Query Editor opens automatically when you select Edit from Navigator. You
can also open the Query Editor by selecting Edit Queries from the Home ribbon in Power BI
Desktop. The following steps are performed in Query Editor.
1. In Query Editor, select the ProductID, ProductName, QuantityPerUnit, and
UnitsInStock columns (use Ctrl+Click to select more than one column, or
Shift+Click to select columns that are beside each other).
2. Select Remove Columns > Remove Other Columns from the ribbon, or right-click
on a column header and click Remove Other Columns.
10
3. Change the data type of the UnitsInStock column
When Query Editor connects to data, it reviews each field and to determine the best data
type. For the Excel workbook, products in stock will always be a whole number, so in this
step you confirm the UnitsInStock column’s datatype is Whole Number.
1. Select the UnitsInStock column.
2. Select the Data Type drop-down button in the Home ribbon.
3. If not already a Whole Number, select Whole Number for data type from the drop down
(the Data Type: button also displays the data type for the current selection).
11
In this step, you expand the Order_Details table that is related to the Orders table, to
combine the ProductID, UnitPrice, and Quantity columns from Order_Details into the
Orders table. This is a representation of the data in these tables:
The Expand operation combines columns from a related table into a subject table. When the
query runs, rows from the related table (Order_Details) are combined into rows from the
subject table (Orders).
After you expand the Order_Details table, three new columns and additional rows are added
to the Orders table, one for each row in the nested or related table.
1. In the Query View, scroll to the Order_Details column.
2. In the Order_Details column, select the expand icon ( ).
3. In the Expand drop-down:
a. Select (Select All Columns) to clear all columns.
b. Select ProductID, UnitPrice, and Quantity.
c. Click OK.
12
2. In the Add Custom Column dialog box, in the Custom Column Formula textbox,
enter [Order_Details.UnitPrice] * [Order_Details.Quantity].
3. In the New column name textbox, enter LineTotal.
4. Click OK.
13
2.Remove the Order_Details. prefix from the Order_Details.ProductID,
Order_Details.UnitPrice and Order_Details.Quantity columns, by double-clicking on each
column header, and then deleting that text from the column name.
6. Combine the Products and Total Sales queries
Power BI Desktop does not require you to combine queries to report on them. Instead, you
can create Relationships between datasets. These relationships can be created on any column
that is common to your datasets
we have Orders and Products data that share a common 'ProductID' field, so we need to
ensure there's a relationship between them in the model we're using with Power BI Desktop.
Simply specify in Power BI Desktop that the columns from each table are related (i.e.
columns that have the same values). Power BI Desktop works out the direction and
cardinality of the relationship for you. In some cases, it will even detect the relationships
automatically.
In this task, you confirm that a relationship is established in Power BI Desktop between the
Products and Total Sales queries
Step 1: Confirm the relationship between Products and Total Sales
1. First, we need to load the model that we created in Query Editor into Power BI
Desktop. From the Home ribbon of Query Editor, select Close & Load.
14
2. Power BI Desktop loads the data from the two queries.
3. Once the data is loaded, select the Manage Relationships button Home ribbon.
5.When we attempt to create the relationship, we see that one already exists! As shown in
the Create Relationship dialog (by the shaded columns), the ProductsID fields in each query
already have an established relationship.
15
5. Select Cancel, and then select Relationship view in Power BI Desktop.
6. We see the following, which visualizes the relationship between the queries.
16
7. When you double-click the arrow on the line that connects the to queries, an Edit
Relationship dialog appears.
8. No need to make any changes, so we'll just select Cancel to close the Edit
Relationship dialog.
17
Exercise - 3
Aim: Data Visualization from ETL Process
Power BI Desktop lets you create a variety of visualizations to gain insights from your data.
You can build reports with multiple pages and each page can have multiple visuals. You can
interact with your visualizations to help analyze and understand your data
In this task, you create a report based on the data previously loaded. You use the Fields pane
to select the columns from which you create the visualizations.
Step 1: Create charts showing Units in Stock by Product and Total Sales by Year.
1. Drag UnitsInStock from the Field pane (the Fields pane is along the right of the
screen) onto a blank space on the canvas. A Table visualization is created. Next, drag
ProductName to the Axis box, found in the bottom half of the Visualizations pane.
Then we then select Sort By > UnitsInStock using the skittles in the top right corer of
the visualization.
2. Drag OrderDate to the canvas beneath the first chart, then drag LineTotal (again, from
the Fields pane) onto the visual, then select Line Chart. The following visualization is
created.
18
Next, drag ShipCountry to a space on the canvas in the top right. Because you selected a geographic field,
a map was created automatically. Now drag LineTotal to the Values field; the circles on the map for each
country are now relative in size to the LineTotal for orders shipped to that country.
19
Exercise-4
Aim: Creating a Cube in SQL server 2012
Source Code:
Let us execute our T-SQL Script to create data warehouse with fact tables, dimensions and
populate them with appropriate test values.
Download T-SQL script attached with this article for creation of Sales Data Warehouse or
download from this article “Create First Data Warehouse” and run it in your SQL Server.
Follow the given steps to run the query in SSMS (SQL Server Management Studio).
For creation of OLAP Cube in Microsoft BIDS Environment, follow the 10 easy steps given
below.
Click on Start Menu -> Microsoft SQL Server 2008 R2 -> Click SQL Server Business
Intelligence Development Studio.
20
Step 2: Start Analysis Services Project
Click File -> New -> Project ->Business Intelligence Projects ->select Analysis Services
Project-> Assign Project Name -> Click OK
3.1 In Solution Explorer, Right click on Data Source -> Click New Data Source
3.1 In Solution Explorer, Right click on Data Source -> Click New Data Source
21
3.2 Click on Next
1. Specify Your SQL Server Name where your Data Warehouse was created
2. Select Radio Button according to your SQL Server Authentication mode
3. Specify your Credentials using which you can connect to your SQL Server
4. Select database Sales_DW.
5. Click on Test Connection and verify for its success
6. Click OK.
22
3.5 Select Connection created in Data Connections-> Click Next
23
3.7 Assign Data Source Name -> Click Finish
4.1 In the Solution Explorer, Right Click on Data Source View -> Click on New Data
Source View
24
4.2 Click Next
4.3 Select Relational Data Source we have created previously (Sales_DW)-> Click Next
4.4 First move your Fact Table to the right side to include in object list.
25
Select FactProductSales Table -> Click on Arrow Button to move the selected object to Right
Pane.
4.5 Now to add dimensions which are related to your Fact Table, follow the given steps:
Select Fact Table in Right Pane (Fact product Sales) -> Click On Add Related Tables
4.6 It will add all associated dimensions to your Fact table as per relationship specified in
your SQL DW (Sales_DW).
Click Next.
26
4.8 Now Data Source View is ready to use.
5.1 In Solution Explorer -> Right Click on Cube-> Click New Cube
27
5.2 Click Next
5.4 Select Fact Table Name from Measure Group Tables (FactProductSales) -> Click
Next
5.5 Choose Measures from the List which you want to place in your Cube --> Click Next
28
5.6 Select All Dimensions here which are associated with your Fact Table-> Click Next
5.8 Now your Cube is ready, you can see the newly created cube and dimensions added in
your solution explorer.
29
Step 6: Dimension Modification
In Solution Explorer, double click on dimension Dim Product -> Drag and Drop Product
Name from Table in Data Source View and Add in Attribute Pane at left side.
Double click On Dim Date dimension -> Drag and Drop Fields from Table shown in Data
Source View to Attributes-> Drag and Drop attributes from leftmost pane of attributes to
middle pane of Hierarchy.
Drag fields in sequence from Attributes to Hierarchy window (Year, Quarter Name, Month
Name, Week of the Month, Full Date UK),
30
Step 8: Deploy the Cube
8.1 In Solution Explorer, right click on Project Name (SalesDataAnalysis) -- > Click
Properties
31
In Configuration Properties, Select Deployment-> Assign Your SQL Server Instance Name
Where Analysis Services Is Installed (mubin-pc\fairy) (Machine Name\Instance Name) ->
Choose Deployment Mode Deploy All as of now ->Select Processing Option Do Not
Process -> Click OK
8.3 In Solution Explorer, right click on Project Name (SalesDataAnalysis) -- > Click Deploy
8.4 Once Deployment will finish, you can see the message Deployment Completed in
deployment Properties.
32
Step 9: Process the Cube
9.1 In Solution Explorer, right click on Project Name (SalesDataAnalysis) -- > Click Process
33
9.3 Once processing is complete, you can see Status as Process Succeeded -->Click Close to
close both the open windows for processing one after the other.
10.1 In Solution Explorer, right click on Cube Name (SalesDataAnalysisCube) -- > Click
Browse
34
10.2 Drag and drop measures in to Detail fields, & Drag and Drop Dimension Attributes in
Row Field or Column fields.
35
Practical 5: Apply the what – if Analysis for data visualization. Design and generate
necessary reports based on the data warehouse data.
A book store and have 100 books in storage. You sell a certain % for the highest price of $50
and a certain % for the lower price of $20.
If you sell 60% for the highest price, cell D10 calculates a total profit of 60 * $50 + 40 * $20
= $3800.
Create Different Scenarios
But what if you sell 70% for the highest price? And what if you sell 80% for the highest
price? Or 90%, or even 100%? Each different percentage is a different scenario. You can use
the Scenario Manager to create these scenarios.
Note: You can simply type in a different percentage into cell C4 to see the corresponding
result of a scenario in cell D10. However, what-if analysis enables you to easily compare the
results of different scenarios. Read on.
1. On the Data tab, in the Forecast group, click What-If Analysis.
36
The Scenario Manager dialog box appears.
3. Add a scenario by clicking on Add.
4. Type a name (60% highest), select cell C4 (% sold for the highest price) for
the Changing cells and click on OK.
37
6. Next, add 4 other scenarios (70%, 80%, 90% and 100%).
Finally, your Scenario Manager should be consistent with the picture below:
38
Exercise 6
AIM :- Using the Data Modeling and Navigation
Source Code :
With the modeling feature, you can build custom calculations on the
existing tables and these columns can be directly presented into
Power BI visualizations. This allows businesses to define new metrics
and to perform custom calculations for those metrics.
In the above image, you can see a common data model, which shows
a relationship between two tables. Both tables are joined using a
column name “Id”.
Similarly, in Power BI, you set the relationship between two objects.
To set the relationship, you have to drag a line between the common
columns. You can also view the “Relationship” in a data model in
Power BI.
To create data model in Power BI, you need to add all data sources in
Power BI new report option. To add a data source, go to the Get data
39
option. Then, select the data source you want to connect and click
the Connect button.
Once you add a data source, it is presented on the right side bar. In
the following image, we have used 2 xls file to import data - Customer
and Product.
In Power BI on the left side of the screen, you have the following
three tabs −
40
Report
Data
Relationships
When you navigate to the Report tab, you can see a dashboard and a
chart selected for data visualization. You can select different chart
types as per your need. In our example, we have selected a Table
type from available Visualizations.
When you go to the Data tab, you can see all the data as per the
defined Relationship from the data sources.
41
In the Relationship tab, you can see the relationship between data
sources. When you add multiple data sources to Power BI
visualization, the tool automatically tries to detect the relationship
between the columns. When you navigate to the Relationship tab,
you can view the relationship. You can also create a Relationship
between the columns using Create Relationships option.
42
You can also use the Relationship view to hide a particular column in
the report. To hide a column, right-click on the column name and
select the “Hide in report view” option.
43
left side of the screen and then click Modeling.
When you navigate to the Modeling tab, you can see a New Column
option at the top of the screen. This also opens the formula bar,
where you can enter DAX formula to perform calculation. DAX- Data
Analysis Expression is a powerful language also used in Excel to
perform calculations. You can also rename the column by changing
the Column text in the formula bar.
44
A long list of formulas is also provided that you can use for creating
calculated columns. You have to enter the first character of formula
to be used in calculations as shown in the following screenshot.
You can also create a new calculated table in data modeling in Power
BI. To create a new table, navigate to the Data View tab on the left
side of the screen, and then go to the Modeling option at the top of
the screen.
45
DAX expression is used to create the new table. You have to enter the
name of a new table on the left side of the equal sign and DAX
formula to perform the calculation to form that table on the right.
When the calculation is complete, the new table appears in the Fields
pane in your model.
To view the report, you navigate to the Report tab and you can see
both “Calculated columns” and fields from the new “Calculated table”
in the report view.
46
Managing Time-Based Data
47
We can enable the drill feature in visualizations using the option at
the top. Once we enable the drill feature and click the bars or lines in
the chart, it drills down to the next level of time hierarchy.
48
Exercise 7
Aim: Creating the Dash Boards
Source Code:
Creating Dashboards
In Power BI, if you want to pin a visual, open the BI report on the
Power BI service. At the top of the visual, select the pin icon.
When you use the Pin option as shown as shown in the above
screenshot, a new dialog box appears as shown in the following
screenshot. It asks you to create a new dashboard or select an
existing dashboard to put the visual from the dropdown list. If you
don’t have an existing dashboard, then this option is greyed out.
49
Once you click the Pin button, you will get a confirmation that your
visualization is “Pinned” to the dashboard. You can click My
Workspace and check the dashboard.
When you publish your BI report to Power BI service, you can share
reports and dashboards with other users in your organization. You
have to open the dashboard in Power BI service.
50
Exercise 8
AIM :- Develop power BI application with various operations in
Dashboard designer.
Source Code:
Power Query Editor: Use the Power Query Editor to transform, clean, and shape
your data. You can remove columns, filter rows, change data types, and more.
Create Relationships: If you're working with multiple tables, establish relationships
between them using the Manage Relationships feature.
Calculated Columns and Measures: Create calculated columns and measures using
DAX (Data Analysis Expressions) to perform complex calculations and aggregations.
DAX Introduction
DAX (Data Analysis Expressions) is a formula expression language and can be
used in different BI and visualization tools. DAX is also known as function
language, where the full code is kept inside a function. DAX programming
formula contains two data types: Numeric and Other. Numeric includes -
integers, currency and decimals, while Other includes: string and binary
object.
51
DAX function can also include other functions, conditional statements, and
value references.
DAX Functions
In Power BI, you can use different function types to analyze data, and create
new columns and measures. It includes functions from different categories
such as −
Aggregate
Text
Date
Logical
Counting
Information
Power BI provides an easy way to see the list of all functions. When you start
typing your function in the formula bar, you can see the list of all functions
starting with that alphabet.
MIN DISTINCTCOUNT
MAX COUNT
Average COUNTA
SUM COUNTROWS
SUMX COUNTBLANK
Logical Functions
Following are the collection of Logical functions −
AND
52
OR
NOT
IF
IFERROR
INFORMATION Functions
ISBLANK
ISNUMBER
ISTEXT
ISNONTEXT
ISERROR
In Power BI, you can create two primary calculations using DAX −
Calculated columns
Calculated measures
When you navigate to the Modeling tab, you can see a New Column option at the top of the
screen. This also opens the formula bar where you can enter DAX formula to perform the
calculation. DAX - Data Analysis Expression is a powerful language used in Excel to
perform calculations. You can also rename the column by changing the Column text in the
formula bar.
53
In the following example, we have created a new column: Product Code (Product_C), which
is derived from the last 3 characters of Prod_Id column. Following is the formula Eg: −
To create a calculated measure, navigate to New Measure tab under Modeling. This will add
a new object under the Fields tab with the name Measure.
54
Hierarchies: Create hierarchies (like Year > Quarter > Month) to enable drill-down features
in your visuals.
I have a sample dataset including a product table with the columns below;
Right-click on the field you want to set as level 1 of the hierarchy in the
fields list, and then select Create Hierarchy.
After that, you will see a new hierarchy created named your field name
“Category” plus the word “Hierarchy”. This would have a hierarchy icon
beside it and also an option to expand to the fields of the hierarchy. If you
expand, you will see a copy of the Category field in there too.
55
Note that the category field inside the hierarchy is just a reference to the
original category column. It is not a new column or duplicate.
Now to add another level to the hierarchy, you can either simply just drag
subcategory to the Category Hierarchy header or right-click on the
subcategory and use Add to hierarchy.
56
This is how simple you can create a hierarchy. If you continue it one more
time for the Product, you’ll have that as a third level of the hierarchy;
57
You can then
Hierarchy can be used for data exploration. With a structure like the
above hierarchies, you can easily drill down or up from a level to another
level. here is an example of drill down visualization;
Power BI uses a default date table, and if you use it, all the date fields looks like a hierarchy
of Year, Quarter, Month and Day. You can, of course, create any other hierarchies you like
but for that I suggest using a custom date table.
58
Hide original columns
A best practice when creating hierarchies is to hide the original columns. This would avoid
the confusion for the report users when they see two different version of the Category field.
one under the Category Hierarchy and one stand alone. You can hide the columns by simply
right click and hide in reports. Or hide them all at once using the model tab.
Choose Visualizations: From the Visualizations pane, drag and drop visual
elements like bar charts, pie charts, line graphs, and tables onto your canvas.
Customize Visuals: Format the visual elements by changing colors, labels, titles, and
more to match your design preferences.
Slicers and Filters: Add slicers and filters to allow users to interact with the data and
drill down into specific areas of interest.
59
Filters are useful for two distinct groups of people. First and foremost,
end users can expand the filter panel to display the available filters and
then filter the data accordingly.
Basic filtering: select which values of the dimension to include or exclude from the
full list of available values
Advanced filtering: filter based on custom string logic for the dimension (ex.
“contains” or “does not contain”)
Top N: filter the dimension to the top (or bottom) value of N based on another field
from the field list. N is a variable that you will specify.
Filter types for number values Filter types for date values
60
5. Interactive Elements
Bookmarks and Selections: Use bookmarks to save the state of your report page, and
use the selection pane to manage layers and elements.
Drillthrough Pages: Create drillthrough pages to allow users to click on data points
and navigate to more detailed reports.
6. Advanced Operations
##//// The Document is getting more so students to learn more about these operations
use the following pdfs.//////####
61
Exercise 9
Aim:- Develop a power BI application with Geographical Maps.
Source code:
Basic map
Filled map
Azure map
Tree map
ArcGIS map
62
How to create maps in Power BI
Step 1. Get and prepare data
To create any map in Power BI, you need to have data with location-
based details. For the examples below, we use a sample dataset
(AmazingMartEU2Geo). It contains a list of orders from different
countries, cities, and regions in Europe along with other information.
You can also automate data load to Power BI from your sources using
Coupler.io. It is a reporting automation solution that supports 60+
apps, such as Google Analytics, Hubspot, Google Ads, and more.
Simply select your desired source in the form below and
click Proceed.
You’ll be offered to create a Coupler.io account for free and set up the
connections.
Keep in mind that to create maps in Power BI, your data meets the
correct geo-location formatting requirements:
63
To solve this issue, log in to the Power BI desktop and Power BI
service using the same email
64
Go to the Visualizations ➡ Format visual. Here you will find 2
options to personalize the map: Visuals and General settings.
The Visual settings are different depending on the type of map you
choose.
65
customize them for geographical analytics and reposting in detail in
the following section.
66
Exercise 10
Aim:- Using the Power BI to create geocoding on maps and
visualize spatial distributions.
Source Code:
After loading a map dataset inside your Power BI, you can see
the Visualizations pane on the right side of the canvas.
Here, you’ll find the icon of Map (basic). Drag and drop the basic
map icon inside the Power BI report. You can expand the map for a
better view and analytics.
Next, select the country or city and drag it inside the Location tab.
Within seconds, you can see the bubbles identifying the European
countries.
In the Power BI basic map, you can also show the bubble size of the
geographical locations. For instance, drag the Order ID in the bubble
Size tab to show how many orders the shop gets from each country.
67
You can see the different sizes of bubbles, depicting the number of
orders. Large bubbles mean more orders, and smaller bubbles mean
fewer. You can simply hold the cursor over the bubbles, it will show
the relevant information e.g. country name and the Count of order in
the tooltip.
68
2. Import Data: Click on Get Data and select the data source
(e.g., Excel, SQL Server, etc.).
3. Load Data: Follow the prompts to load your data into Power BI.
3. Geocode Data:
# For Example:-
69
(ArcGIS is a built-in visual in Power BI. You can find it among all other
visualization choices. We have a course on data visualization in
Power BI if you'd like extra guidance on visualizing data in Power BI
and the best practices.)
Click the ArcGIS icon to add it to the Power BI canvas. In the options
on the right-hand side, you will see the types of fields that this visual
supports. We add the neighborhood column to the Location field and
the latitude and longitude columns to their respective fields. We want
to visualize the prices of Airbnb listings in Los Angeles, so we add the
price column to the Size field.
70
In addition to the information in our dataset, we add an additional
infographic card to the chart. This is a feature offered by ArcGIS, and
it dynamically changes based on the items we can see - in this case,
we have zoomed into Los Angeles. Since we are dealing with property
data, we added the average home value. This adds some context to
the relative prices of Airbnb listings we see in this visual.
Based on the size of the circles, we can see that Malibu has some of
the most expensive Airbnb listings!
2. Filter Data:
71
3. Add Tooltips:
1. Analyze Data:
Map Settings: You can choose the Power BI map styles such
as Arial, Dark, Light, Grayscale and Road. Select any of
them from the drop-down to change the map theme instantly.
You can also show or hide the map labels as well.
72
Legend: Turn on/off the legend value
Bubbles: Select custom bubble scaling, size, and color
73
Environmental Monitoring: Track air quality, water pollution,
and natural disasters in real-time.
Limitation(s):
Has a steeper learning curve compared to other mapping
options.
74
Customize ArcGIS maps in Power BI
The customization settings of ArcGIS are different from other Power BI
maps. You will find a hamburger menu icon over the created map
at the top left corner. Click on it, you can see multiple options to
personalize your ArcGIS map, such as:
Active Layer: Manage which data layer is emphasized on the
map i.e. coordinates.
Search field: Enable search functionality to find specific
addresses or locations on the map.
Coordinates: Display latitude and longitude coordinates for
data points.
Basemap: Change the underlying background map style or
theme such as Grey Scale Canvas, Light Scale Canvas, Open
Street Map, and Streets.
Additional settings: You can also see additional settings for further
customization. You can show the selected region
with Infographics such as population, age, housing, health,
education, etc.
75
You can also add a reference layer, and find the drive/buffer time in
the ArcGIS map. Choose your input layer e.g. Coordinates and then
select your location using the selection shape like arrow, circle,
rectangle, etc. After that, select the analysis time from the drop-
down, including Ring buffer and Drive time. Next, write the time
and click on Run Analysis.
For instance, we select the 30-minute distance locations from the city
of Exeter. The ArcGIS map shows all the destinations that one can
reach within 30 minutes of driving from the city.
76
Along with these, common customizations are also available for
ArcGIS maps in Power BI. You can find the Visual and General settings
on the Format Visuals tab. Here you can customize the layout, zoom
control, location type, title, effects, header icons, etc.
<Additional Information>
Power BI filled maps
Filled maps in Power BI go beyond basic location data distribution.
They use color intensity to reveal areas with high or low
concentrations of your chosen data point. For instance, you can show
sales figures using a filled map where red areas represent high-selling
regions, while blue areas indicate lower sales.
77
Sales Performance Analysis: Identify top-performing
regions.
Customer Concentration: Target areas with high customer
density.
Resource Allocation: Visualize and adjust resource
distribution.
78
Map settings: Customize the filled map theme from the
available 5 styles
Legend: Enable or disable the legend data value
Fill colors: Select your preferred color to fill the specific areas.
Tooltips: Add hover tooltips for region-specific data values.
79
Logistics Optimization: Analyze routes and minimize delivery
times with real-time traffic data.
Location Intelligence: Understand customer demographics
and market trends using spatial data.
Asset Management: Monitor and track the location of assets,
vehicles, or equipment using geofencing.
Limitation(s)
Limited to 30,000 data points (latitude/longitude or locations)
80
Customize Azure maps in Power BI
Azure Map offers extensive customization options in Power BI. In
addition to the styling options like general settings, and themes, you
will find multiple control options. You can turn on/off the controls
for World wrap, Style picker, Navigation and Selection.
81
Traffic Layer: Another interesting option in Azure maps is the traffic
layer. You can find real-time data on traffic for your specific region.
Simply turn on the Traffic layer and zoom in to the desired location.
You can see the real-time traffic conditions of the selected area.
82
<Additional Information>
Power BI treemaps
Power BI Treemaps are visualizations that display hierarchical
data using nested rectangles. Each rectangle represents a specific
category or subcategory. They provide a compact and efficient way
to visualize data in Power BI with hierarchical structures and compare
data values across different levels.
Key Features:
Hierarchical data display with customizable formatting.
83
How to make Power BI treemaps
To create a treemap, connect to your data source and load the
relevant dataset into Power BI. Next, select the Treemap icon to add
a treemap to your report canvas from the Visualizations pane.
Also, drag the desired hierarchical data fields (categories and
values) from your dataset into the appropriate fields in the treemap
visualization.
Power BI will automatically generate the treemap based on the
hierarchical structure of your data, with rectangles representing
categories and given values.
For our case, we wanted to depict the regional data of each country.
Where the larger the rectangle is, the more regions the country has.
You can simply see the exact number via the tooltip by hovering over
the particular rectangle.
84
Customize treemaps in Power BI
In the format Visual tab, you will find treemap customization options
such as:
85
Exercise 11
Aim:- Create an interactive exploration of maps using Power
BI
Source Code:
Prerequisite: Power BI – Timeseries,
Aggregation, and Filters
86
Maps:
Using a Power BI map is a great way to visualize
data that represent locations. With visually
appealing maps and easy-to-understand content,
your users will be able to gain more insight into your
data. Before using Maps in Power BI, we need to
first understand how to create and work
with Hierarchies within the given dataset.
Steps Involved:
87
Steps Involved:
88
Fig 5: Power BI: Column vs Measure
Steps Involved
89
Scatter Plots:
90
Fig 8 : Power BI : Conditional Formatting
On following the above steps, we get a schematic,
color coded Scatter plot. (As shown in Fig 9)
91
interactive reports. You can add various multiple
visualizations to get important information out of
the report. Here is an example BI Report containing
maps, scatter plots, slicers and donut chart.
Steps Involved:
Step 1 - Create a new page.
Step 2 - Simply copy your previous visualizations
(Map and Scatter plot) and paste it onto the new
page.
Step 3 - Drag and drop two slicers from Visualization
pane. Then, from the 'ListOfOrders' dataset drag and
drop :
3.a - OrderDate into first slicer.
3.b - Region into second slicer.
Donut Chart:
92
space for a label or icon.
Steps Involved:
Step 1 - Select 2 Donut chart from the Visualization
panel and drag it into the Report view.
Step 2 - Select OrderDate from'ListOfOrders' dataset
and drag it into the donut chart.
Step 3 - Select Profit from 'ListOfOrders' dataset and
drag it into the values section. (as shown in Fig
11)
93
Exercise 12
Aim:- Develop power BI application with MongoDB
Source Code:
Procedure
Procedure
Follow these steps to enable Atlas SQL and connect with Power BI.
a. If it's not already displayed, select the organization that contains your desired
project from the Organizations menu in the navigation bar.
c. If the Clusters page is not already displayed, click Database in the sidebar.
a. On the lower right side of the cluster card under Atlas SQL, click Connect.
b. If the Introducing the Atlas SQL Interface dialog box displays, click Get
Started.
94
Quick Start configures a federated database instance for your cluster with the
default settings.
4 Under Create an Atlas SQL Connection for this cluster, click Create.
5. Under Select your driver, select Power BI Connector.
6. Under Get Connection String, select a database and copy the URL.
NOTE
To use Direct Query, you must install MongoDB ODBC Driver version 1.2 or later.
3
Download and install the MongoDB Atlas Power BI Connector.
NOTE
The MongoDB Atlas Power BI Connector is included with Power BI Desktop. If your
version of Power BI Desktop already has the MongoDB connector, you can skip this
step. To use a different version than the one bundled with Power BI Desktop,
complete this step.
1
2
Move the connector file to the following directory path: C:\Users\<user>\Documents\
Power BI Desktop\Custom Connectors .
95
1. Open Power BI Desktop.
2. Select Get data from the Home menu.
3. Find and select the MongoDB Atlas SQL connector.
c. Click Connect.
96
4. Enter the URI and the database name and click OK.
The MongoDB URI is the URL is the from the previous step.
You can also enter a SQL query in the Native query field. Power BI uses the SQL
query as the direct source for the data.
97
5. Enter your Atlas User name and Password and click Connect.
By default, a user can access all clusters and federated database instances in
projects to which they have access. If you restricted access to specific clusters and
federated database instances, you can grant access to the new federated database
instance in the Edit User menu. To learn more, see Modify Database Users.
Your selected data is available for use with Power BI's visualization
tools.