Power-BI-for-Beginners 5
Power-BI-for-Beginners 5
Power BI for
Beginners
T. SHAEEN, J. SCHELLINCK | SYSABEE | DATA ACTION LAB
P. BOILY | UNIVERSITY OF OTTAWA | DEPARTMENT OF MATHEMATICS AND STATISTICS IDLEWYLD ANALYTICS | DATA ACTION LAB
Projects
§ GAC; NWMO; CATSA; etc.
§ 40+ projects
Specialization
§ Data visualization; data cleaning (… unfortunately)
§ Application of wide breadth of techniques to all kinds of data
§ Mathematical/statistical modeling
Projects
§ Global Affairs Canada
§ Small and medium enterprises
§ Labour Market Information Council
Specialization
§ Statistical training
§ Data presentation and data storytelling
Contact Info:
Slack Workspace:
[email protected]
https://dspdi.slack.com
[email protected]
Power BI, the latest addition to Office 365, enables users to aggregate and interpret massive
data in a user-friendly environment. With this data visualization tool, analysts build custom
data analysis and dashboards with scheduled automated updates: empowering managers’
decision making with accurate and intuitive real-time measures.
This fast-paced introductory course to Microsoft’s Power BI application covers key concepts
for delivering effective automated dashboards. This is a hands-on training session:
participants learn Power BI’s functionalities as they build an interactive report. Best practices
for data visualizations and dashboards are described and applied through examples.
It also has projects (Major Capital MC, Minor Capital MIC, Operations and
Management O&M, and Salary SA), and departments.
Instructor Demos (ID): sit back, relax, and take it all in.
Behind the Scenes (BS): a summary of what has been prepared for you.
As we want to encourage you to play with the tool without fear that you will break it
(or what we have planned), we have prepared 8 Power BI dashboard files (PBIX), at
various stages of development, which you can load to re-enter the stream at any
moment.
Download PBIfB.zip from the course website, and unzip the file to an easily
accessible location on your hard drive, to which you will also download the course
datasets.
Download this one to your hard drive too, in the same location (you may also
need to rename the file). Project FTE (- Group-
Code Date out + Level
PR001 01-Apr-18 2 AS-04
PR002 01-May-18 2 AS-05
PR003 01-Jun-18 2 ENG-01
PR004 01-Jul-18 4 PR-01
PR005 01-Aug-18 3 PA-03
PR006 01-Sep-18 2 AS-02
PR007 01-Oct-18 1 CR-03
PR008 01-Nov-18 3 FI-02
PR009 01-Dec-18 4 FO-03
PR010 01-Jan-19 2 CR-01
PR011 01-Feb-19 3 AS-03
Tab – Project Tombstone
Tab – Project FTE Count
Effective Journal
Date Voucher Type
Code
Description
Amount
have an Transactions
Journal Director
Voucher Item Accounting
Amount Control Number
Director
Budget
belong to a is managed by a
O&M Budget
has a
Salary
Budget
Project
Major Cap
Budget
Project
Minor Cap Identifier
Budget
Project Name
FTE Budget
I. Power Query
POWER BI FOR BEGINNERS
20
1. Load Data (PA)
We might want to “tweak” the data before loading it into
Power BI. We can accomplish this using the Power
Query Interface (see detailed instructions, p. 1).
1. Open Power BI.
2. Close the yellow “Hello” screen.
3. In the “Home” ribbon at the top of the Power BI screen, there
is a clickable region named “Get Data” – activate it to bring
up several data format options.
4. Among all the options, select “Excel”.
5. Click on Data Set - Accounting.xlsx, and select
“Open”.
27
3. Change Data Types (ID)
We proceed with the following steps (see the detailed instructions document):
1. go to the “Fields” pane and drop down on “Accounting Transactions”;
2. after clicking on “Item Amount” you will see that new options appear in the top Ribbon,
namely, “Column Tools”;
3. this is where we go to change the data type for “Item Amount” from a decimal value to
a currency; we also change “Effective Date” into a short date.
In the Model, the two tables are linked by the “Project Identifier” variable.
We enter the “Data Model” view and remove the link. Now the two tables are
unlinked, meaning that they cannot “talk” to one another.
???
For the first part of this dashboard (Exploration 1, Exploration 2), we only use
the data from 2018.
34
6. Pre-Analysis Use (BN)
Data visualization can be used to set the stage for analysis:
§ detecting anomalous entries
invalid entries, missing values, outliers
§ shaping the data transformations
binning, standardization, Box-Cox transformations, PCA-like transformations
§ getting a sense for the data
data analysis as an art form, exploratory analysis
§ identifying hidden data structure
clustering, associations, patterns informing the next stage of analysis
Data Visualization
Power Query uses the language “M” in the background; Power BI uses “DAX”.
Basic charts are created using the Power BI Graphic User Interface (GUI); for
more complicated/sophisticated things, we need to use M and/or DAX.
What is M?
§ M is the data transformation engine in Power BI (prior to loading data into the model)
§ M contains commands to transform data and to return the results of the query and trans-
formations to the Power BI data model
§ normally, we use M Query to query data sources, clean, and load data
§ instead of bringing 3 tables into Power BI, say, we can remove unneeded columns and
merge the tables into a single table to load into the model (this reduces load and
improves performance, which is crucial for larger datasets)
For instance, we might want to create charts that focus on the various “Item
Amount” categories :
§ Total Major Capital
§ Total Minor Capital
§ Total Operations and Management
§ Total Salary
We create a new page for the dashboard, called “Exploration 2”, and we place
a page filter on it to ensure that we are only using 2018 transactions.
Note that:
§ “Item Amount $k Measure” is a measure residing in the “_Measures” table
§ “Item Amount $k” is a column residing in the “Accounting Transactions” table
While they ostensibly relate to the same idea (and are both calculated using
DAX formulas), they are emphatically different Power BI entities (more on
this later).
For instance, we can format the original “Item Amount” column and the
calculated column “Item Amount $k” (from the “Accounting Transactions”
table) so that they are displayed with 2 decimal places.
There is a spike in the previous chart that seems like it would be worth
exploring in more detail.
59
[Wexler, Shaffer, Cotgreave, The Big Book of Dashboards]
Examples:
§ interactive display that allows people to explore motor insurance claims by city, province,
driver age, etc.
§ PDF showing key audit metrics that gets e-mailed to a Department’s DG on a weekly basis.
§ wall-mounted screen that shows call centre statistics in real-time.
§ mobile app that allow hospital administrators to review wait times on an hourly- and daily-
basis for the current year and the previous year.
Take a simple scenario in which we flag any transactions for which “Item
Amount” is over $100,000. We create a calculated column as follows:
§ if the “Item Amount” is equal to or greater then $100,000, then we add the word “Check”
§ otherwise, we leave the value in the new column blank
Note that there is no filter on Effective Date year from this point on.
82
[C. Nussbaumer Knaflic, Storytelling with Data]
When we were monitoring the situation, we realized that there was a potential
issue with C. Power transactions:
§ gigantic 820,000$ transactions coded as Minor Capital late in the data
§ small average transaction value
§ small standard deviation value
We apply a page filter to “Storybook 2” so that the corresponding charts are all
affected by a 10,000$ “Item Amount” limit (see detailed instructions, p. 6).
Power BI is not necessarily the greatest tool for that last step (although it can
do some of it, it does not do so naturally); don’t hesitate to use other tools as
needed.
100
49. Publish a Power BI Dashboard (BN)
This allows audiences to fully interact with the dashboard without the need to
install Power BI on their computers.
After hitting the “Publish” button, Power BI will ask to save the
dashboard to a workspace (like an online folder).
106
References
P. Boily, S. Davies, J. Schellinck, The Practice of Data Visualization. Data Action
Lab, 2022.
P. Boily, J. Schellinck, Data Understanding, Data Analysis, and Data Science.
Data Action Lab, 2022.
A. Saxton, P. Leblanc. Guy in a Cube. Guy in a Cube, LLC, 2022.
M. Russo, A. Ferrari, D. Perilli. sqlbi. SQLBI, 2022.
N.B. The Microsoft resources found under the help ribbon in PowerBI can also be very helpful. There
are links for guided learning, training videos, documentation, support, a blog, and community.