Power Bi Guide Beginner
Power Bi Guide Beginner
Power Bi Guide Beginner
for Beginners:
A Step-by-Step Training Guide
Senthilkumar.S
Contents
1. Introduction Page 03
7. Conclusion Page 18
8. Appendix Page 19
2
01. Introduction
In this how-to guide, we give you an overview course of Power BI and how it can be used
to load, manipulate, model, and report on data to assist with your reporting requirements.
The scenario we’ll run through is how to report on internet sales for the fictitious
AdventureWorks bicycle company and adding some common time intelligence
measures, for example, period to date and period against previous period reporting.
We will take you through the typical process of loading data, modelling data and then
visualising the data.
If at any point you are unaware of terminology, refer to the glossary in the appendix.
When you see the symbol this is an extra tip or trick you might find useful.
Note that Power BI occasionally updates its user interface, so screenshots in this guide
may vary slightly to what you see on your screen.
You will have received the sample files in your email (alongside this guide).
1. Follow the link “You’ll also need to download these sample files”.
Then
This process is followed at the start of a new project, to import the data that you’ll be
working with, and at any point in the future when you need to add new data to the project.
• Open Power BI Desktop application from your local system (Fig 1).
Selecting the down arrow on the Get Data button, shows the most common data sources
menu. Select More… to open the Get Data dialog.
• Browse to the unzipped data files you saved in step 3.2, select the first file
DimCustomer.csv, and click Open.
• In Fig 4, you can see the options Load and Transform Data. For now, click Load to
import the data directly into Power BI. This imports the data as it is, and loads it into
Power BI Desktop.
Clicking Transform Data will take you to Power Query Editor. This allows you to perform
any required changes on the file before importing into Power BI. You can change the
table name, column name, data type of a column, remove data or delete columns, and so
on, in this Editor.
• Repeat the same process and load all other sample files (DimDate, FactInternetSales,
DimProduct, DimProductCategory, and DimProductSubCategory).
Note that you will have to load these one at a time.
• At this point it would be useful to Save the Power BI Desktop model.
The data has now been loaded into the Power BI model and you have a blank canvas to
start working with.
Let’s take a moment to explore this report canvas, the Power BI Desktop application:
Report Design,
Data Transformation,
and Data Modelling views
Report Canvas
1. The left menu is used to switch between, Report Design, Data Transformations
and Data Modelling (creating relationships within your data).
2. The Report Canvas is for Visual Design and Layout.
3. The Application ribbons contain all options and settings, visual or page level
properties, and other settings configuration.
4. The report building panes contain all the components that may be added to a
report. You can:
a. Select fields and data from imported tables on the Fields pane.
b. Select different ways to display this data from the Visualizations pane.
c. Apply filtering to the data in the Filters pane.
Once the required data is loaded, there may be a need to use Power Query Editor
to shape the data by removing unnecessary columns, changing data types, adding
new calculated columns, and so on. Power Query Editor is not covered further in this
document.
Relationships between tables are necessary to accurately calculate results and display
the correct information in the reports. In this next section, we will use the data that has
been loaded to find and create these relationships between the tables.
Power BI Desktop makes creating relationships easy through an Auto Detect feature.
When the data is loaded, Power BI Desktop will attempt to find and create relationships
for you based on column names in the tables. If there are matching column names, these
relationships are created automatically.
You will notice some relationships have been automatically created between a few of the
tables:
Fig 8. Relationships
1. Relationship: The line between two tables represents that a relationship exists.
2. Direction: The arrow indicates which direction filtering will occur. In this example: If
DimProduct is filtered on a particular value, FactInternetSales will also be filtered to
only show records related to the selected value.
3. “One” side: The 1 indicates that the relationship works off a single unique record on
the DimProduct table.
4. “Many” side: The * indicates that the relationship links to many records on the
FactInternetSales table.
• Select Modeling from the top menu. Then select Manage Relationships.
• Select New…
• Select DimProduct from the first dropdown box
• Highlight the column ProductSubCategoryKey
• Select DimProductSubCateogory from the second dropdown box
• Highlight the column ProductSubCategoryKey
• Ensure the Cardinality is set to Many to One (*:1), Cross filter direction is set to
single and “Make this relationship active” is ticked.
• Click Ok.
1. Follow steps 2 to 4 above to create the rest of the relationships displayed in Fig 11,
below:
Fig 11. Manage relationships. This is the view once all relationships have been created.
At this point you are able to begin creating visuals on the reporting canvas.
Now that the data has all been uploaded and modelled, we can begin reporting on that
data.
Let’s start with a graph to support a simple business case: Our Sales Manager would like
to track the value of our website bike sales over the last few years.
• Select the Stacked Column Chart visual from the Visualization pane
• This will add a grey “place holder” graphic to the Report Canvas.
• Using the Fields pane on the right of the screen, complete the following steps:
i) Go to FactInternetSales:
(1) Click the down arrow to expand the list.
(2) Click and drag the SalesAmount to the grey
“place holder” graph on
the Report Canvas.
(3) You will notice that
SalesAmount now appears
in the Value field of the
Visualizations pane.
ii) Go to DimDate:
(1) Click the down arrow to expand the list.
(2) Click and drag the CalendarYear attribute to
the Axis field on the Visualization pane.
(3) You can now see the value of internet sales
(SalesAmount) over time
• Click Save
With multiple visualisations visible on a page, Power BI Desktop allows you to cross-
highlight data between visualisations. You would do this to further drill down into your
data.
• In the Report Design view, looking at the two visualisations created above, click on
the Professional slice of the Pie Chart.
• Not only is this slice highlighted, but the portion of InternetSales related to
Professionals is also highlighted on the Stacked Column Chart.
We’ll now create a table that displays sales amount and sales amount YTD.
Time intelligence provides richer analytics by providing measures that simplify time-
based reporting, for example, time-based calculations for Year-to-Date (YTD), Month-
to-Date (MTD), and Previous Period comparisons. The Date dimension (DimDate) is the
basis for time intelligence reporting in this example.
Initial Configuration
Fig 13. Highlighting the FullDateAlternateKey column and checking the Data Type
It’s best practice to make sure that the Data Type is set to Date to facilitate the Time
Intelligence functionality of Power BI Desktop.
You can check this on the Modeling ribbon, as indicated above.
Power BI Quick Measures are pre-defined calculations provided by Microsoft and can be
created on the fly.
• In the Quick Measures dialog, go to the Calculation drop-down box, select Time
intelligence and then select the Year-to-date total
• Click OK.
• Power BI Desktop adds your new measure to the Fields pane and displays the DAX
code that was generated.
The generated DAX code is fully functional and requires no further changing.
You may wish to experiment with the DAX code, but it is strongly advised that only
qualified BI technicians edit or create DAX code for business-critical systems.
• Using the Fields pane on the right of the screen, complete the following steps:
i) From DimDate expand FullDateAlternateKey and tick Date Hierarchy, Year and
Quarter.
ii) From FactInternetSales, tick SalesAmount and SalesAmount YTD.
• Click Save
The Report Canvas now shows a table of Sales values, by Quarter, with the accumulated
Year to Date values alongside.
Fig 18. Table displaying SalesAmount by Quarter and Year and the YTD running total
We have taken you through how to import data from multiple Excel files and join related
data to build up a meaningful data model that you can use to visualise and interact with.
By using the Quick Measures feature you have been able to extend measures with time
intelligence to enhance analysis without writing any code and to provide meaningful in-
sights.
If you would like further training, you can find out more about our training courses or email
us enquiries@theta.co.nz.
8.1 Glossary
Data transformation
Converting data from one format/structure to another format/structure
Visualise
Graphical representation of data
Shaping/shape
Also known as wrangling or manipulation. The process of transforming and mapping data
from one “raw” data form into another format so that it is more appropriate/valuable for
analytical purposes
Power Query Editor
A dedicated window that facilitates and displays your data connections and
transformations you apply
Report Canvas
A blank canvas area where visualisations are placed
One-to-Many
A type of cardinality that refers to the relationship between two entities A and B in which
an element of A may be linked to many elements of B, but a member of B is linked to only
one element of A. For instance, think of A as product, and B as a number of sales of that
product
Auto detected
When loading data from different sources, Power BI Desktop will automatically detect or
create relationships between two or more tables
Quick measures
Lets you quickly create new measures (calculations) without coding based on measures
and numerical columns in your table
Dimension
Descriptive data that adds context to transactional (fact) data e.g. year/month/date,
location, customer and product. They are in the filters/columns/rows field.
Fact
Transactional data that is generally aggregated in report visuals, e.g. sum of amount.
DAX
A collection of functions, operators, and constants that can be used in a formula, or
expression, to calculate and return one or more values.