Intro 2 Power BI
Intro 2 Power BI
Power BI is used in different ways depending on the role of the individual, from
developers, analysts, managers, and directors, to everyone in between.
Excel is a spreadsheet software and while it does contain much of the same core
functionality as Power BI, it has limited visualization options and lacks the ability to
refresh, share, and view reports and dashboards online.
Prof.Manoj Kumar N 1
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Power BI Desktop is one of the core elements of Power BI and it is the main application
for designing and building reports.
It is recommended to download Power BI Desktop from the Microsoft Store as there are
a few advantages:
Keep in mind that you cannot have both the Microsoft Store version and the version
from the download center installed on your computer at the same time. If you do need
to switch, then be sure to first uninstall your current version of the application before
installing the next.
When you launch the application, Power BI will start with a blank report. Let's go over
the components of the Power BI Desktop:
• Ribbon - the top ribbon contains most of the controls and options
needed for building the report.
• Views - this is made up of the report view, the data view, and the model
view.
• Canvas - this is the main design area where visualizations and other
elements are added.
• Page selector - for navigation to other pages in the report.
• Filters - fields can be added here to filter the data.
• Visualizations - this contains the list of available visualizations.
• Fields - this section contains the tables and fields that are available in
the data model.
Prof.Manoj Kumar N 2
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Prof.Manoj Kumar N 3
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Importing Data
As stated at the beginning of the tutorial, you can download the sample data and
import it by selecting the Excel data source.
A preview window will pop up where you can select the table or sheet you want to
import from the Excel file. Tables and sheets are designated by their respective icons. It
is generally better to import tables as they are neatly defined in Excel with strict
headers and row boundaries.
Prof.Manoj Kumar N 4
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Here you can also choose whether to load the data directly or go straight to the Power
Query Editor using the Transform Data option. Choosing to first transform your data
before loading it in can be advantageous as there are often little errors and issues that
you may want to iron out first. Select Transform Data and a separate window will open
up for the Power Query Editor.
Power Query
The Power Query Editor can be broken up into 4 main parts:
• Ribbon - the top ribbon contains almost all of the data transformation
options you need to shape your data. We will explore a few common
transformations below.
• Queries - this lists all the queries you have set up for this report. For
complex reports, you can organize queries into groups for better
navigation and management.
• Data view - this is the main table containing the data for the selected
query as well as a formula bar. A preview of the data is shown with only
the first 1000 rows.
Prof.Manoj Kumar N 5
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Here, the financial sample data is already very clean so there are no transformation
steps for us to apply. However, these are some of the most common transformation
steps:
• Removing rows and/or columns - some Excel data can have a lot of
blank rows and/or columns inserted for readability and aesthetic
purposes, but these are not useful in Power BI and should be removed.
• Changing data types - data types such as number, date, or text should be
specified for each column. Power BI will try to automatically detect the
data type, yet it can sometimes be wrong or there can be errors so it is a
good idea to always double-check the data types.
• Combining data with merge and append - similar to join and
concatenate in SQL, these transformations allow you to combine queries
from multiple sources.
• Pivot and unpivot - these options allow you to transform your data from
a wide to a long format and vice versa. The unpivot option is
particularly useful when dealing with Excel files that have information
(such as dates) running across the columns of a table rather than as
rows.
• Adding a conditional column - this is a useful transformation that allows
you to add a column based on if/then/else logic.
Prof.Manoj Kumar N 6
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Lastly, select Close & Apply from the ribbon to get started with building and designing
the report.
Prof.Manoj Kumar N 7
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
1. Select a field from 1 table and drag it onto the field in the second table
with which you want the relationship to form.
2. Select Manage Relationships from the ribbon and then select “New” to
add a relationship using the same window that we will be discussing
next (except that it will start as blank).
By default, Power BI will try to infer a relationship between tables - it doesn't always get
this right so you may wish to turn this feature off in the settings. To edit the
relationship, right-click the connecting line between them and select “Properties”.
This window has 2 interesting options to choose from when defining a relationship:
cardinality and cross filter direction. The choices for each of these options can have a
big impact on the resulting report, so choose carefully. Let's break down each of these
options.
Prof.Manoj Kumar N 8
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Cardinality has 4 choices: many to one, one to one, one to many, or many to many. When
creating relationships, it is recommended that the joining field contains unique values in
at least 1 of the tables. In our data, we have a relationship between the Financials table
and the Products table using the Product field. The Products table has unique values for
the Product field (each product only appears once in the table). However, the Financials
table can have each product showing up several times by date, country, segment, etc.
Cross filter direction gives a choice between single and both directions. Relationships
flow from the table with unique values to the table with many values. In our case, the
relationship flows from the Products table to the Financials table. This means that if the
cross filter direction is set to single, then the Financials table can be filtered by the
product and product category fields in the Products table, but the Products table cannot
be filtered by using the product field in the Financials table.
DAX
Calculations in Power BI are powered by formulas called DAX or Data Analysis
Expressions. DAX allows you to create new fields and even new tables in your model.
You can perform 3 types of calculations in Power BI that use DAX formulas:
Prof.Manoj Kumar N 9
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Visualizations
There are a variety of visualizations available in Power BI—bar charts, line charts, pie
charts, tables, matrices, simple cards, KPI's, gauges, interactive maps, and much more.
On top of that, there are many formatting options that you can play around with too.
You can also import custom visualizations if the visual you want is not on the list.
Simply click the ellipsis and a window will pop up where you can browse all the
available visuals -- this is known as Microsoft AppSource. You can even design your
own visuals if you have the programming experience.
Prof.Manoj Kumar N 10
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
In this tutorial, we build a simple report that contains these visuals: slicers, clustered
bar charts, a line chart, and a KPI. We will go over how the clustered bar chart and the
KPI are created, the others should be easy to replicate on your own.
Prof.Manoj Kumar N 11
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
To insert a clustered bar chart, select the icon in the visualization pane and a blank bar
chart visual will appear on the canvas. Drag the 'Segment' field to the Axis, and drag our
new measure 'Profit margin' to the Values. A title and all the axis headers are
automatically populated for us based on the fields we added to the visual.
Since the profit margin is negative for one of the segments, we are going to add some
conditional formatting to make that negative value clearly stand out. Select the
formatting icon at the top of the visualization pane and then go down to the “Bars”
options. Here we can change the colors of the bars. To apply conditional formatting,
select the “fx” symbol and a window will pop up where you can apply rules based on the
value of any field. Here we select the Profit margin field and specify that the color
should be red if the number is less than 0.
Prof.Manoj Kumar N 12
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
KPI Visual
To insert a KPI visual, select the icon in the visualization pane and a blank KPI visual
will appear on the canvas. This KPI will be based on the Profit margin measure that we
created earlier. Drag the “Profit margin” field to “Value”.
Prof.Manoj Kumar N 13
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Next, we will add a target of 20% for the KPI. We could add the target by dragging a
measure field under the “Target value” (this is useful if the profit margin target is used
in other visuals) but we will instead select the formatting icon and enter the target value
under the “Gauge axis” section.
Prof.Manoj Kumar N 14
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Prof.Manoj Kumar N 15
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Data
Publishing a report also publishes the data and you will see this separately in your
workspace. You can use this data to create new reports from the Power BI Service.
Whenever you republish a report, the data will be overwritten, so watch out for any
changes to the data that could break the reports that are created from this data in
Power BI Service.
Select the data and you will be brought to a screen where you can see an overview of all
the reports that are built using this dataset. From this screen, you can also create a
report using this data or share this data with others. If you have a Power BI Gateway set
up, you can also refresh the data either manually or on a schedule.
Report
Prof.Manoj Kumar N 16
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Go back to your workspace and now select the report. From here you can view and
interact with the report as well as do a few other useful things, such as:
• Export the report as an Excel, PowerPoint, or PDF file for your own data
analysis or presentation.
• Share the report with other people.
• Subscribe to the report so that you receive emails on a schedule or
when the report is refreshed.
Each visual also has a number of options:
Prof.Manoj Kumar N 17
MICROSOFT POWER BI – BEGINNER’S HANDOUTS
Dashboard
You can pin entire reports or individual visuals to dashboards. The biggest benefit of
using dashboards is that they allow you to pin visuals from different reports in your
workspace. This way, you can easily keep track of important metrics in one place rather
than clicking on each report to see them.
References:
1. https://www.datacamp.com/tutorial/tutorial-power-bi-for-beginners
2. https://powerbi.microsoft.com/
3. https://docs.microsoft.com/power-bi/
4. https://www.selecthub.com/business-intelligence/power-bi-vs-tableau/
5. https://www.cio.com/article/3609423/excel-vs-power-bi-which-is-right-for-
you.html
Prof.Manoj Kumar N 18