Data Analysis and Visualization
Data Analysis and Visualization
Table of content
Introduction............................................................................................................................................. 2
Task 1. Data import ................................................................................................................................. 2
Task 2. Data preparation ......................................................................................................................... 3
Task 2.1. Setting data types................................................................................................................. 3
Task 2.2. Adding calculated columns .................................................................................................. 6
Task 3. Visualizing data in charts and tables ........................................................................................... 6
Task 3.1. Natural language queries ..................................................................................................... 7
Task 3.2. Changing the layout and format ......................................................................................... 8
Task 3.3. Adding tables and charts ...................................................................................................... 9
Task 4. Relationships in tables............................................................................................................... 10
Task 4.1. Adding another table ......................................................................................................... 10
Task 4.2. Adding related columns ..................................................................................................... 13
Task 5. Spatial visualization ................................................................................................................... 14
1|Page
Introduction
Power BI is a Data Visualization and Business Intelligence tool that converts data from different data
sources to interactive dashboards and BI reports. Power BI suite provides multiple software,
connector, and services - Power BI desktop, Power BI service based on Saas, and mobile Power BI
apps available for different platforms. These set of services are used by business users to consume
data and build BI reports.
Power BI desktop app is used to create reports, while Power BI Services (Software as a Service - SaaS)
is used to publish the reports, and Power BI mobile app is used to view the reports and dashboards.
Power BI Desktop is available in both 32-bit and 64-bit versions. To download the latest version, you
can use the following link −
https://powerbi.microsoft.com/en-us/downloads/
Choose “Cars” worksheet (you will see the preview of the worksheet) and click “Load”.
2|Page
To see your data imported choose the icon on the left side of the screen.
3|Page
We need to change the type of some fields that should be numbers, these are:
Year_resale_value
Curb_weight
Engine_size
Fuel_capacity
Length
Price_in_thousands
Sales_in_thousands
Width
4|Page
Click on the column header to select
data type from the drop-down menu.
For the fields that should be in
currency format choose “Using
Locale..” option. Choose “English
United States”
In the case of errors, go to Options and Settings (the button on the left top corner of the screen)
If the wrong currency symbol is displayed you can change it in Modelling Tab.
5|Page
Task 2.2. Adding calculated columns
In our example of sales analysis of cars there is no column with sales value (which could be useful in
reports and visualization). But we can easily add the new column it by multiplying the price and the
number of cars sold.
To do this click “New Column” on the “Modeling” ribbon and type in the formula bar:
The new column with calculated value should appear as the last one in the dataset.
6|Page
Task 3.1. Natural language queries
In Power BI we can ask (not very sophisticated) queries in natural language. It is useful feature
that saves time.
Try to ask other questions in natural language, for example Average fuel efficiency by
manufacturer
7|Page
Task 3.2. Changing the layout and format
You can sort the data on the chart by sales value or manufacturer.
Try to add a pie chart to your report. Use the right side of the screen (drag&drop the fields)
8|Page
Try some options, feel free to choose colors and fonts, add a legend…
Add new page to your report. Make a line chart and table showing Prices and year resale value
by car model. Do some formatting to your chart.
9|Page
Use scatter chart to visualize horse power and price of cars.
Add a funnel control to the chart to change the range of variables displayed
10 | P a g e
Click “Get Data” on “Home” ribbon and add to
your project the excel file
CarManufacturersByCountry.xlsx
11 | P a g e
Then in editing mode, open the drop-down menu
As you can see the relationship between our two tables was automatically recognized by Power
BI. The relationship is one to many.
12 | P a g e
Task 4.2. Adding related columns
We are going to add another column to our “Cars” table which will be the name of the Country
where the manufacturer’s headquarters are located.
And display the table “Cars” (choose from the Fields on the right of the screen.
The table “Cars” must be displayed because now we are going to add related column to it.
1
DAX (Data Analysis Expressions) is a formula expression language and can be used in different BI and
visualization tools.
13 | P a g e
Start tying in the formula bar. Change the column name to “Country”
New column in the data set should appear as the last one, containing names of countries.
Since we have spatial data field in our dataset we can use maps for visualizations in our report.
To change the style of the map click on three dots in the upper right corner of
your map.
14 | P a g e
Add another map showing the
number of distinct Manufacturers
by Country (how many
manufacturers there are in each
country)
After completing all of the tasks save your report as pdf and send it to the e-
learning platform.
15 | P a g e