Вы находитесь на странице: 1из 103

POWER BI: ESSENTIALS

Abstract
Power BI allows the everyday Excel user to become a Business Intelligence Analyst.
Create stunning reports and dashboards, poignant data visuals, and design highly
insightful DAX measures with Power BI. Microsoft's Power BI landscape allows easy
data clean-up and data modelling directly in the Power BI application, or the user has
the choice to accomplish these same tasks in Excel.
Microsoft Power BI Essentials Training Guide

Complying with all applicable copyright laws is the responsibility of the user. All rights
reserved. Without limiting the rights under copyright, no part of this document may be
reproduced, stored in or introduced into a retrieval system, or transmitted in any form or
by any means (electronic, mechanical, photocopying, recording, or otherwise), or for
any purpose, without express written permission of LearniT!.

Microsoft, Microsoft Press, ActiveX, Excel, FrontPage, Internet Explorer, PowerPoint,


SharePoint, Webdings, Windows, and Windows 7 are either registered trademarks or
trademarks of Microsoft Corporation in the United States and/or other countries. Other
product and company names mentioned herein may be the trademarks of their
respective owners.

Unless otherwise noted, the example companies, organizations, products, domain


names, e-mail addresses, logos, people, places, and events depicted herein are
fictitious, and no association with any real company, organization, product, domain
name, e-mail address, logo, person, place, or event is intended or should be inferred.

Course Manual Version 1.0

i
Microsoft Power BI Essentials Training Guide

Contents
About this Training Course .......................................................................................................... vii
Course Description ...................................................................................................................... vii
How to Use this Manual .............................................................................................................. vii
Course Outline ............................................................................................................................ viii
Day 1: Getting Started with Power BI....................................................................................... 10
Learning Objectives ................................................................................................................... 10
What is Excel Power BI? ............................................................................................................. 10
Programs and Files You Will Need: ........................................................................................... 10
How to Install Power BI Desktop? ...................................................................................... 11
Download Power BI Exercise Files ..................................................................................... 12
What’s New in Excel 2016? .................................................................................................... 12
Data Analysis Tools & Terminology Changes .................................................................. 12
Built-In Apps .......................................................................................................................... 13
Office 365—Excel Online vs. Excel Native ....................................................................... 15
Excel Add-Ins (only for Excel 2013 users) .......................................................................... 15
Power BI Community .................................................................................................................. 15
Power Query - Get and Transform Data ................................................................................. 16
What is a Data Query?........................................................................................................... 16
Querying Data from Excel ..................................................................................................... 17
Query Editor ............................................................................................................................. 17
How to Launch Query Editor ............................................................................................. 17
Overview of Query Editor Interface .................................................................................. 18
RIBBON OVERVIEW: HOME TAB ................................................................................................. 19
Append Queries in Query Editor ....................................................................................... 19
Rename Queries.................................................................................................................. 20
Querying Online Data ............................................................................................................ 20
Querying Text Files .................................................................................................................. 20
Merging Tables ........................................................................................................................ 21
Expanding Tables ....................................................................................................................... 21
Best Practices for Normalizing Concepts............................................................................. 22
RIBBON OVERVIEW: TRANSFORM TAB ................................................................................... 21

ii
Microsoft Power BI Essentials Training Guide

How to transform data into smallest meaningful value ................................................. 23


Split Data across Columns ................................................................................................. 24
Removing Columns / Blank Rows ...................................................................................... 24
Rename a column header ................................................................................................ 25
Remove Columns ................................................................................................................ 24
Remove Other Columns ..................................................................................................... 24
Remove Blank Rows ............................................................................................................ 25
Converting Data Types....................................................................................................... 25
Remove Query Steps .......................................................................................................... 25
Merging Columns ................................................................................................................ 25
Types of Common Errors ..................................................................................................... 26
Expanding Tables ....................................................................................................................... 26
Ribbon Overview: Add Column ............................................................................................... 27
Adding Custom Columns (Calculated Columns) .......................................................... 27
Reusing Queries ....................................................................................................................... 28
LAB 1: Creating & Editing Queries ............................................................................................ 82
Introduction to Power BI Desktop ............................................................................................. 29
What is Excel Power BI? .......................................................................................................... 29
Start Screen.............................................................................................................................. 29
Exploring the Power BI Desktop Interface ........................................................................... 29
Report (formerly Power View) ........................................................................................... 30
Data ...................................................................................................................................... 30
Relationships ........................................................................................................................ 30
Field List ................................................................................................................................. 31
Querying Data from Excel ..................................................................................................... 31
Querying a CSV file................................................................................................................. 32
The Query Editor ...................................................................................................................... 32
When to use Excel vs. Power BI Desktop?........................................................................ 32
Creating and Editing Queries ............................................................................................ 32
Renaming Tables ................................................................................................................. 32
Delete Redundant Queries ................................................................................................ 33
Select and Move Data Columns ...................................................................................... 33
Detect Relationships ........................................................................................................... 33

iii
Microsoft Power BI Essentials Training Guide

Creating Reports & Visualizations ............................................................................................. 35


Changing values in visualizations ............................................................................................. 36
Formatting ................................................................................................................................... 37
Visual Elements .................................................................................................................... 37
Visualizations .......................................................................... Error! Bookmark not defined.
Creating Visuals .......................................................................................................................... 38
Basic Column Chart ............................................................................................................ 38
Gauge Visual ....................................................................................................................... 38
Gauge visual. ......................................................................... Error! Bookmark not defined.
Map Visual............................................................................................................................ 39
Cards ..................................................................................................................................... 41
Text Boxes ............................................................................................................................. 42
Slicers..................................................................................................................................... 43
Shapes .................................................................................................................................. 45
Creating Filters ............................................................................................................................ 45
Fields...................................................................................................................................... 46
Lab 2: Creating Reports & Visuals ............................................................................................ 46
Day 2: Data Modeling in Excel ................................................................................................. 48
Day 2: Learning Objectives: ...................................................................................................... 48
Opening Power Pivot ............................................................................................................. 48
Creating Data Models in Power Pivot.................................................................................. 48
Retreiving External Data from an Excel Table ................................................................. 49
Sorting & Filtering Imported Data...................................................................................... 50
Importing Data from Access ............................................................................................. 51
How to Filter Data Imported from Access ....................................................................... 53
Changing Import Choices ................................................................................................. 53
Create a Power Pivot Table ............................................................................................... 54
Create Relationships ........................................................................................................... 56
Creating Calculated Columns .......................................................................................... 58
Create Calculated Columns using the RELATED Function ............................................ 59
Creating Hierarchies ............................................................................................................... 60
Ancestor & Derived Measures .............................................................................................. 61
Measures Terminology ........................................................................................................ 61

iv
Microsoft Power BI Essentials Training Guide

Creating measures in Power Pivot .................................................................................... 62


Creating measures in Excel ............................................................................................... 62
DAX Measures ......................................................................................................................... 63
COUNTROWS........................................................................................................................ 63
DISTINCTCOUNT ................................................................................................................... 63
Compound measures......................................................................................................... 64
CALCULATE .......................................................................................................................... 65
CALCULATE using measures .............................................................................................. 65
Lab 3: Practice with Measures and DAX Measures ............................................................... 66
Day 2 Afternoon – Power BI with Modelled Data .................................................................. 67
Importing a Data Model ........................................................................................................ 67
Data Modelling Overview in Power BI ................................................................................. 68
Data Mode........................................................................................................................... 68
Relationships Mode ............................................................................................................. 68
Creating Calculated Columns & Measures in Power BI .................................................... 69
Creating Calculated Columns .......................................................................................... 69
Creating Measures .............................................................................................................. 69
Lab 4: Creating Data Models in Power BI ............................................................................... 70
Introduction to Calendar Tables & Time Intelligence............................................................ 71
Why Calendar Tables?............................................................................................................... 75
Criteria for creating Calendar Tables ...................................................................................... 75
Ways to create a calendar:...................................................................................................... 75
Creating a Calendar Table in Power BI ............................................................................... 76
CALENDARAUTO .................................................................................................................. 76
CALENDAR ........................................................................................................................... 76
DAX—Date & Time .................................................................................................................. 77
Connecting Dates to Data ....................................................................................................... 78
Creating Relationships ........................................................................................................ 78
Creating reports using dates ............................................................................................. 78
Introduction to Time Intelligence ............................................................................................. 79
DATESYTD .............................................................................................................................. 79
Lab 5: Creating Calendar Tables ............................................................................................. 80
Day 2: Dashboards ..................................................................................................................... 81

v
Microsoft Power BI Essentials Training Guide

Publish Online to the Power BI Service..................................................................................... 71


Creating Dashboards................................................................................................................. 72
Pin Tiles to Dashboards ....................................................................................................... 72
Sharing Dashboards ................................................................................................................... 74

vi
Microsoft Power BI Essentials Training Guide

About this Training Course


Course Title: Power BI Essentials
Course Code:
Target Audience: Business professionals who want to learn
Power BI. Excel users who want to take
their data mastery to the next level.
Participant Prerequisites: Participants should prior experience with
Microsoft Excel and be familiar with
Office 365 and Excel Online. It is
recommended that participants have
taken LearniT! Excel Day 2 and Excel Day
3 courses and/or have a general
understanding of databases, Pivot Tables
and Excel Functions.
Software required: Excel 2013 or newer.
Format: Instructor-led training with hands on
exercises.
Length: Two day course.

Course Description
Power BI Essentials is a fast-paced, two-day, hands-on training course designed for the
everyday Excel user to gain business intelligence and analysis skills. The course is
designed to take participants through a project-based approach where they will learn
about big data, how to organize and clean data, design highly insightful DAX
measures, and transform data into stunning reports, dashboards, and data visuals.

Participants will explore Microsoft's Power BI landscape within the Desktop and through
Office 365 online environment. This course will also focus on new features within Excel
that allow users to clean data and design data modelling directly within Excel and the
Power BI application.

How to Use this Manual


This guide is useful for anyone who has taken Day 1, 2 or 3 of Power BI at LearniT! There
are multiple ways to use this guide:

 Quick overview—Scan it for a quick overview of a topic.


 Visual tour—Take a visual tour of Power BI Desktop by scanning screen images of
Power BI interface and arrows pointing out important features.
 Comprehensive overview—Follow along with the activities and exercises done in
class with step-by-step instructions, including access to exercise files and visual
hints.

vii
Microsoft Power BI Essentials Training Guide

Course Outline
Day One

Module 1: Getting Started with Power BI

 What is Power BI?


 Getting the Tools
 Power BI and Excel
 Discovering Insights with Power BI (Data Analysis Objectives)
 PBI Ecosystem

Module 2: Get and Transform Data with Power Query

 Introduction to Power Query


 Get & Transform in Excel
 Creating queries
 Importing data from various sources
 Appending and merging queries
 Data normalizing strategies
 Reusing Queries

Module 3: Introduction to Power BI Desktop

 Introduction to Power BI Desktop


 Concepts (Power BI compared to Excel)
 Importing data from Excel
 Issue queries directly from Power BI
 Building reports
 Creating simple visualizations
 Telling a story with Power BI Reports
 Creating slicers
 Using charts as slicers

Day 2

Module 4: Data Modeling

 Concepts of Power Pivot and "Data Model" in Excel


 Importing Data from Various Sources
 Modelling & Relating
 Concepts of creating a Data Model (Decision Structures)
 Creating Relationships
 Creating Calculated Columns
 Designing Measures
 Building Hierarchies
 Data Analysis Strategies
 Essential DAX expressions

viii
Microsoft Power BI Essentials Training Guide

Module 5: Power BI

 Concepts (Power BI compared to Excel)


 Importing a Data Model from Excel
 Data Modelling directly in Power BI
 Importing Additional Data
 Creating Calculated Columns and Measures in Power BI
 Introduction to Time Intelligence
 Calendar Tables
 Essential Time Intelligence DAX expressions
 Building Interactive Reports
 Concepts: Reports for Consumption
 Standard slicers
 Charts as Slicers
 Disconnecting Visuals 
 Drilling Down with Hierarchies

Module 6: Power BI Online

 Dashboards vs. Reports


 Pinning Visuals
 Excel Objects Online
 Publish and Share Dashboards and Reports
 Using Q&A

ix
Microsoft Power BI Essentials Training Guide

Day 1: Module 1
Getting Started with Power BI
Learning Objectives
 What is Power BI?
 What are the different parts of the Power BI ecosystem?
 How do the Power BI tools differ from the tools in Excel

What is Excel Power BI?


Excel Power BI (POWER BI) is a fully-integrated suite of business analytics tools that will
enable your business to analyze data from anywhere and share insights with anyone.
You can now monitor your business at your desk and on the go, and get quick answers
to complex questions through rich dashboards and stunning charts and graphs. All
while doing away with unmanageable spreadsheets.

POWER BI allows users to:

 Pull data from multiple sources and transform it into tables, charts, graphs,
interactive maps, reports, and dashboards
 Produce data models and queries
 Pull big picture results, patterns and trends
 Deep dive into data sets

What’s more, conducting data analysis in Excel no longer requires obscure add-ins,
plugins and software downloads. Data analysis features have been renamed and
integrated into Excel’s interface to make user experience easy and seamless.

Programs and Files You Will Need:


 Windows 8.1 or Windows 10
 Microsoft Office 2013 or 2016 & Excel Desktop
 Power BI Desktop (click here for directions on how to install)
 At least one of these Internet browsers (Chrome, Edge, IE, Firefox…etc.)
 Microsoft Office 365 (cloud supported subscription)
 Power BI app installed on a smart phone/mobile device

(c) LearniT! 2016. All Rights Reserved. 10


www.learnit.com
Microsoft Power BI Essentials Training Guide

How to install Power BI Desktop?


To install POWER BI Desktop your computer must be running the newest .NET framework.
If you don’t know if you have the newest .NET framework, try downloading the POWER
BI Desktop. If you don’t have the newest .NET framework, you will get a notification. See
below for step-by-step instructions:

 Go to the POWER BI downloads site:


https://powerbi.microsoft.com/en-us/downloads/
 Download the file
 Run the downloaded file

If you receive the below message:

1. Cancel the installation and download the newest .NET framework by going to:
https://www.microsoft.com/en-us/download/details.aspx?id=30653.

(c) LearniT! 2016. All Rights Reserved. 11


www.learnit.com
Microsoft Power BI Essentials Training Guide

2. Install the newest .NET framework:

3. Run installation
4. Now, run the Power BI installer (repeat steps 1-3) to run POWER BI Desktop.

Download Power BI Exercise Files


1. Go to www.learnit.com/files
2. Click on the following links:
a. Power BI > Work Files

What’s New in Excel 2016?


Data Analysis Tools & Terminology Changes
Microsoft renamed many of its data analysis “Power” tools i.e. Power Query, Power
Pivot, Power Maps, etc. See below for a list of the new terminology:

 3D Maps (formerly named Power Maps)


 Data Model (formerly named Power Pivot)
 Get & Transform Data (formerly named Power Query)
 Power BI Desktop and Cloud Service remain the same
 Power View is not on the ribbon (you can get it though)

(c) LearniT! 2016. All Rights Reserved. 12


www.learnit.com
Microsoft Power BI Essentials Training Guide

Built-In Apps
Users with Excel 2013 or prior are required to download separate Add-Ins to access
Power BI tools. Users with Excel 2016 or newer, now have access to these tools, such as
Get & Transform Data and Data Model, directly in the Data tab of the ribbon.

3D Maps is now located in the Insert tab.

Power BI Desktop vs. Excel


Excel is a robust platform that can be used to build data models and analyze large
data sets. Both Excel and Power BI Desktop enable users to conduct queries, design
data models and use data analysis tools. The benefits of using Excel for data analysis
include:

 Exploring, filtering and transforming data through tables, pivot tables and pivot
charts (Power BI has similar features, however they are less powerful)
 Building key performance indicators (KPIs)
 Creating visualizations using charts, pivot charts, conditional formatting

Power BI Desktop has an enhanced user experience in which the data analysis tools are
a part of the interface and the user doesn’t have to jump between multiple
applications to reach them. In addition, users can conduct data clean-up and data
modeling directly in the application.

(c) LearniT! 2016. All Rights Reserved. 13


www.learnit.com
Microsoft Power BI Essentials Training Guide

Added benefits to using Power BI Desktop include:

 Enhanced interface and user experience—data analysis tools are part of the
interface and users will not have to jump between multiple applications to use
various tools.
 Improved and easier to use visualizations—more visualizations are available and
users can create custom visuals and use them in dashboards and reports.
 Creating reports & dashboards—see data through live dashboards and
interactive custom or pre-built reports.
 Enhanced importing data features—users can import queries, data models and
Power View worksheets into Power BI, in addition to having other data
import/export options. Users can also import data from various databases and
file formats, including a new integration with Azure services.
 Cloud-based functionality—data can be connected through SharePoint and
Microsoft Office cloud services. Users have unlimited data storage with a 365
Office subscription.

Any data and tools used in Excel can be converted over into Power BI.

Power BI Online & Mobile Apps


Power BI mobile app can be used with mobile devices including Android, iOS, and
Windows. Users have access to view, edit and share dashboards, reports, charts and
graphs. Content packs are constantly being released providing integration with services
including: Adobe Analytics, Azure Mobile Engagement, Google Analytics, Marketo,
Salesforce.com, Sentry, SQL and more.

(c) LearniT! 2016. All Rights Reserved. 14


www.learnit.com
Microsoft Power BI Essentials Training Guide

Office 365—Excel Online vs. Excel Desktop


Excel online will be used later in this course to host data. You will need to add Power BI
to your Office 365 Portal to be able to access all dashboard features.

How to Add Power BI to your Office 365 Portal

(Note: You will download this when you begin to use Power BI online and create
dashboards.)

1. Go to https://powerbi.microsoft.com/en-us/ > Sign In


2. Enter your username & password (you may need to wait 10 minutes for Microsoft
to initialize Power BI to Office 365)
3. Power BI will show up in the waffle of Office 365 (see image on next page for
visual)

Excel Add-Ins (only for Excel 2013 users)


If you have Excel 2013, you will need to get the following add-ins:

 Power Pivot
 Power Query

To download the add-ins follow these steps:

 File tab > Options > Add-ins tab in left-hand toolbar


 COMM Add-ins > “Go”
 Check the box for the following add-ins:
o “Microsoft Power Pivot for Excel”
o “Microsoft Power Query for Excel”

Power BI Ecosystem
The Power BI community is where users can collaborate, share code and strategies and
learn tips and tricks. Click here to join the discussions: www.community.powerbi.com.

(c) LearniT! 2016. All Rights Reserved. 15


www.learnit.com
Microsoft Power BI Essentials Training Guide

Day 1: Module 2
Power Query—Get and Transform Data
Learning Objectives
In this module, you will learn:

 Benefits of “importing” with Power Query compared to other methods like copy
and paste.
 Concepts and benefits of normalizing data (organize, clean and sort) before
importing into Power BI
 How to save and re-use queries
 The difference between “load to table” and “load to data model”

Ribbon Overview: Get and Transform


Get and Transform enables users to transform data from rows into columns, change text
to numbers, remove rows, set the first row as headers, ensure data labels are consistent,
merge fields and create new calculations in data...etc. You can combine data and
connect to two or more data sources, then consolidate them into one useful query.

What is a Data Query?


A query retrieves data. The questions you will need to answer to perform a data query
include:

 What data do you want to retrieve?


 Where does the data live?
 How do you want to organize the data?
 Where do you want to put the data?

(c) LearniT! 2016. All Rights Reserved. 16


www.learnit.com
Microsoft Power BI Essentials Training Guide

Querying Data from Excel


To import data from an Excel file, click on the
following in the ribbon:

 Data tab > New Query > From File > From
Workbook
 Select the file [GeographyAsia.xlsx]
 A navigator window will appear > Click on
GeographyAsia > Import
 Click Load
 Import the other two exercise files doing the same thing:
o [GeographyEurope.xlsx]
o [GeographyNorthAmerica.xlsx]
 You will be able to see all three data sets showing up on the right side navigation
window called Workbook Queries. If you do not see this navigation panel do the
following:
o Click on DATA tab > “Show Queries”

The table will import into Excel workbook. The file you are importing does not have to be
in perfect condition, Power BI will help you automate normalization. However, you may
save time if you clean the data before importing.

Query Editor
The Query Editor will enable you to modify and preview data before importing into
Excel. For example, once you have imported data you may find the following issues:

 Columns headers are unnamed


 Entirely blank rows or columns
This would be a reason to open the Query Editor.

How to launch Query Editor


 Hover over the query in Workbook Queries navigation pane OR right click on the
query
 Select Edit to launch the Query Editor

(c) LearniT! 2016. All Rights Reserved. 17


www.learnit.com
Microsoft Power BI Essentials Training Guide

Overview of Query Editor interface

This is the Query


Settings Pane,
found by
clicking on the
View tab in the
ribbon.

Users can
reorder and
remove steps.
Table Preview

(c) LearniT! 2016. All Rights Reserved. 18


www.learnit.com
Microsoft Power BI Essentials Training Guide

Ribbon Overview: Home Tab

Close & Load—exit the Query Editor

Use First Row as Headers—Assign headers to first row of data if imported data does not
have headers. This will promote contents in Row 2 into column headers.

 Hover over query


 Click Edit to go to Query Editor
 Click on Use First Row as Headers in the Ribbon
 Close & Load

Append Queries in Query Editor


When data is located in different queries, Append will combine all data together in one
table. Bringing all data into one table (with the same structure) makes it easier to do
Power BI functions. Appending queries will add rows of one table to the bottom of
another table.

 Select query in Workbook Queries to combine


 Click on Query Tools contextual tab > Append
 Choose a Primary table (data that will be at the
top of the list) [GeographyAsia.xlsx]
 Select a secondary table [GeographyEurope.xlsx]
 Choose the desired table and click OK (this will
launch the Query Editor)
 To add additional queries:
o HOME > Combine > Append
Queries
o Choose another table from pull-
down menu [North America]

(c) LearniT! 2016. All Rights Reserved. 19


www.learnit.com
Microsoft Power BI Essentials Training Guide

Rename Queries
To rename a query:

 Query Settings > Properties > Name


 Name your query by typing in text box labeled “Name”
 Save & Close (combined data will be located in the last
worksheet tab)
o Rename the tab that contains combined queries to
“All Regions”

Querying Online Data


Users can import data from online tables to add to their current
queries and complete missing data. For example, in “All
Regions” worksheet, the column COUNTRIES is missing country
names.

 Open an Internet browser > find the website that


contains the data to be imported
 Copy the URL where the online data is located
o http://blog.learnit.com/Files/powerbi.html
 In Excel, click on: Data tab > New Query > From Other
Sources > From Web
 In the From Web window, paste the URL
 Click OK
 Select the Table
 Click Load
 Rename the query “Continents” (see above to rename queries)

Querying Text Files


Users can create new queries or combine tables from .txt files.

 In Excel, click on: Data tab > New Query > From File >
From Text
 Locate the file location > [GeocodesGeometry.txt]
 Click Import
 Rename the query “GeoCodes” (see above to rename
queries)
 Click Close & Load
You may need t o enable First Row as Headers feature in Ribbon.

(c) LearniT! 2016. All Rights Reserved. 20


www.learnit.com
Microsoft Power BI Essentials Training Guide

Ribbon Overview: Transform Tab

Merging Tables
Merging tables enables users to combine
different queries into one table. Merging adds
new data side-by-side the existing data.

 In Workbook Queries > select the “All


Regions” query
 Query Tools contextual tab > Reference
(this creates a new table from an existing
table)

Now you will merge “Continents” into the “All


Regions” Query. In the Query Editor:

 HOME > Merge Queries


 In the Merge window, choose
“Continents” from pull-down menu
 Match the two “Continents” columns
together by clicking on each column in
the top and bottom table previews.
 Click OK
Note: There is a new column that has been added
and the data in the column repeats the word
“Table”. See Expanding Tables .

Expanding Tables
Sometimes when users merge tables, Excel is not able to identify which
columns should be linked across queries. If you have merged tables and
the columns are not identified, you will see a column on the right called
“New Column” and the data will be called “Table.” Users can use the
feature Expand to connect the corresponding columns of data.

(c) LearniT! 2016. All Rights Reserved. 21


www.learnit.com
Microsoft Power BI Essentials Training Guide

 In Query Editor, click on the TRANSFORM > Expand


 Select the column you want to display
 In the Default column name prefix: delete text and leave
blank
 Click OK
 Rename Query “Merged”
 Click Close and Load

Best Practices for Normalizing Concepts


Normalizing data means ensuring data is in the best format for its primary purpose.
Transform and Get has a lot of normalizing strategies that require less time and energy
than performing the same tasks in Excel. Normalizing concepts include:

 Smallest meaningful value—Breakdown fields to their smallest meaningful value.


For example, columns that combine last and first name should be broken into
separate columns for first name and last name to make searching easier.

 Remove unnecessary data—Any columns or rows that are meaningless or will not
be used for your analysis should be removed.

 Errors—Address all errors in your data before conducting data analysis.

 Compliant field names— Ensure fields (column/row headers) have unique names
that explicitly refer to the corresponding content. Do not include characters that
could be mistaken for formula syntax (e.g. {} ; : ‘ , /). Ensure field naming
consistency within and across data sets.

 Standardize data—Delete any interfering characters that come in with imported


data (i.e. dollar signs or spaces).

 Standardize data types—Make sure columns are appropriately formatted to


match the data (currency, dates, numbers, text, etc.)

 Create key/ID fields—Add columns that provide unique identifying numbers or ID


numbers for data. This will make identifying relationships between data sets
easier to establish.

 Replace values—Ensure data is consistent and simplified (i.e. convert all the
semi-colons to commas).

(c) LearniT! 2016. All Rights Reserved. 22


www.learnit.com
Microsoft Power BI Essentials Training Guide

Smallest meaningful value


You will need to transform data into the smallest meaningful value when:

 You have delimiters that break apart data


 Delimiters are consistent across all data fields

In Query Editor:
 Select column
 HOME > Replace Values
 Value to Find: “;”
 Replace with “,”
 OK

To split the column:


 HOME > Split Column > Split by Delimiter
 From pull-down menu, choose “Custom” because you have two delimiters:
o Comma
o Space
 Type in “,” “ “
 OK

Note: Field names you have just created are “State, Region 1” and “State, Region2”. These
are NOT “compliant field names.

(c) LearniT! 2016. All Rights Reserved. 23


www.learnit.com
Microsoft Power BI Essentials Training Guide

Split data across columns


Split the values in a column into two columns.

 Select the column to be split


 Click on Split Column
 Select “Split Column by Delimiter”
 Identify delimiter (character that identifies where
the split should occur)
 In “Split by Delimiter” window choose a delimiter
option
 If fields are split by multiple delimiters, choose
Custom
 Type in delimiters (i.e. comma, space)
 Click OK
 Right-click on new columns to Rename each
column

Removing columns / blank rows


Removing unnecessary columns or rows will cut down on inefficiencies and errors during
data analysis.

 Select “Actual” column


 HOME > Remove Columns

Remove other columns


If you have a lot of data and need to delete
most columns. Removes all columns not
selected.

(c) LearniT! 2016. All Rights Reserved. 24


www.learnit.com
Microsoft Power BI Essentials Training Guide

Remove blank rows


If blank rows are included in the table,
future data analysis may be distorted (i.e.
averaging values). Blank rows can appear
after importing data. This feature will
remove all blank rows in.

 HOME > Remove Rows > “Remove


blank rows”

Rename a column header


 Double-click to rename each column to “State” and “Region”.

Converting data types


Importing data can result in incorrectly formatted data. It is important to ensure that all
data is formatted to support the correct data type (i.e. values should be formatted as
Numbers or Currency). To change data type:

Exercise

 Select the columns to be formatted


 TRANSFORM > “Data Type: Any”
 Change “any” to the appropriate data type
 Change data type for the following columns:
o Locations (Whole number)
o Employees (Whole number)
o LoadDate (Date/Time)
o UpdateDate (Date/Time)
o Project Revenue (Currency)
o Actual Revenue (Currency)
o Difference(Currency)
o % Difference (Decimal number)

Remove query steps


 Click on Query Settings to open the navigation pane
 Click in Applied Steps to see a list of actions you have taken and remove

Merging columns
Combine two columns of data into one column.

 Select the columns to be merged


 TRANSFORM > Merge Columns
 Separator window: enter a delimiter if desired (none for exercise)
 New column name: create a name for the merged column “GeoCodes”

(c) LearniT! 2016. All Rights Reserved. 25


www.learnit.com
Microsoft Power BI Essentials Training Guide

 Click OK

Types of common errors


1. Processing Errors—Problems with a formula or function.
2. Import/Data Errors

Exercise: Error Handling—Edit how errors appear

 Click in the Transform tab


 Click on Replace Errors
 Type in the text to replace the error “Actual”
 Click OK
Note: There is an option to Remove Errors on the HOME tab,
which will remove errors .

Expanding Tables
Sometimes when users merge tables, Excel is not able to identify which
columns should be linked across queries. If you have merged tables and
the columns are not identified, you will see a column on the right called
“New Column” and the data will be called “Table.” Users can use the
feature Expand to connect the corresponding columns of data.

(c) LearniT! 2016. All Rights Reserved. 26


www.learnit.com
Microsoft Power BI Essentials Training Guide

 In Query Editor, click on the TRANSFORM > Expand


 Select the column you want to display
 In the Default column name prefix: delete text and leave
blank
 Click OK
 Rename Query “Merged”
 Click Close and Load

Ribbon Overview: Add Column

Adding custom columns (calculated columns)


Add new columns of data to include new calculations based off of other columns of
data.

 ADD COLUMN tab > Add Custom Column


 In New column name, enter a name for the column
 In Custom column formula, enter formula and
double-click on the corresponding column in the
right-hand toolbar to insert it into a formula (see
image below)

Exercise:

o Double click on “Employees”


o “*1.15”
o This leaves you with this formula:

=[Employees]*1.15

o Rename New Column name to: “Projected Employees”


o Rename the Query “COMPLETED”

(c) LearniT! 2016. All Rights Reserved. 27


www.learnit.com
Microsoft Power BI Essentials Training Guide

Reusing Queries
Refresh--Pulls the original data and new or updated data, and runs all existing queries.

Duplicate –Run an existing query on data in a different tab in Excel, while keeping the
original query result.

Reference–Create a different query based on the result from an existing query. The new
query is dependent upon the original. If the original query changes, the dependent
query will change.

Reusing Queries Elsewhere (copying M script1)—Run an existing query on data from a


different file.

 Copy and paste the query:


o Query Editor > Home tab > Advanced Editor > Copy the Code OR right-
click on a query > copy
 Paste it in a different file
Note: The table names in the other file must match the original query and the data must be
similar.

LAB 1
Navigate to the back of this guide and find LAB 1.

1Covered in Power BI: Day 3. This feature only available for users with active Office 365
subscriptions or the Excel 2016 or newer.

(c) LearniT! 2016. All Rights Reserved. 28


www.learnit.com
Microsoft Power BI Essentials Training Guide

Day 1: Module 3
Introduction to Power BI Desktop
Learning Objectives
By the end of this module, you will be able to:

 Importing data into Power BI Desktop


 Issue queries directly from Power BI
 Build reports and create simple visualizations
 Telling a story using Power BI Reports

What is Excel Power BI?


(Go to page 13 for the differences between Excel and Power BI)

Start Screen
When you open Power BI Desktop, you will be sent to the
Start Screen. The Start Screen includes the following
features:

 Access recently used files


 Watch or read tutorials about Power BI

To exit the Start Screen, click on the “X” in the upper-right


corner.

Components of Power BI Desktop


The three tabs in the Power BI ribbon are:

 File
 Home
 Modeling

(c) LearniT! 2016. All Rights Reserved. 29


www.learnit.com
Microsoft Power BI Essentials Training Guide

Under the ribbon, the left-side toolbar is called the modes Bar.
The three modes are:

 Report mode
 Data mode
 Relationships mode

Report mode (formerly Power View)


Reports are a key feature of Power BI. A report is a multi-
perspective view into your data that includes visuals that
represent different findings and insights from your data. A report may have a single
visual or pages of visuals.

Data mode
Create data models, like in Power Pivot. Once you have imported data, click Data
mode to see your data, including:

 Columns
 Tables are displayed on the right-side.
 Icons appear next to the table columns. The small sigma icon signifies a column
of numbers.

Relationships mode
Connect and link data tables by creating relationships.

(c) LearniT! 2016. All Rights Reserved. 30


www.learnit.com
Microsoft Power BI Essentials Training Guide

Field lists
Depending on the mode you have selected; a field list will appear in the right-side
toolbar. Field lists pull in the data fields you are working with, similar to a pivot table.

Querying Data from Excel


You can import and clean data from Excel while
working in Power BI.

Exercise

 HOME > Get Data > Excel


 Select the file you want to import form the
Navigator window
o Exercise file: [Geography.xlsx]
o Check mark box: [COMPLETED] table
 Optional: By clicking Edit in the Navigator window, you can edit and clean the
data before importing
 Load

(c) LearniT! 2016. All Rights Reserved. 31


www.learnit.com
Microsoft Power BI Essentials Training Guide

Querying a CSV file


 HOME > Get Data > CSV
 Choose the file to import
o Exercise: [Employees.csv]
 Load

The Query Editor


Both Excel and Power BI allow users to create queries. Depending on your preference,
you may want to create queries in Power BI, instead of Excel. The Query Editor is where
you will modify queries in either Excel or Power BI.

When to use Excel vs. Power BI Desktop?


Power BI Excel
 Pivot Tables
 Dashboards
 Pivot Charts
 Stunning visuals
 Online Analytical Process (OLAP)
 Mobile consumption
Tools
 Alerts & life data
 VBA

Creating and editing queries


 FIELD pane > right click on query > “Edit Query”
 Rename [COMPLETED] query to “Geography” (see below)

Renaming tables
By renaming tables, you will be able to search for data more efficiently.

 Select Data Mode > right-click on the


table
 Rename

Note: The Power BI Query Edit or ribbon is the


same as in Excel.

(c) LearniT! 2016. All Rights Reserved. 32


www.learnit.com
Microsoft Power BI Essentials Training Guide

Queries
Queries Steps
List

Query
Preview

Delete redundant queries


Exercise

 Select the query to edit from the Query List on the left-side toolbar
o “Geography”
 HOME > Remove Columns:
 Select columns/rows/data to delete
 Remove the following columns:
o Continent
o Locations
o Employees
o ContinentName
 Select Close & Apply

Select and move data columns


 Select the query to edit from the Query List on the left-side toolbar
 Click and drag columns to reorder

Detect relationships
Use Power BI to connect and link tables so that you can run analysis across data sets.

Exercise

(c) LearniT! 2016. All Rights Reserved. 33


www.learnit.com
Microsoft Power BI Essentials Training Guide

 HOME > Manage Relationships


 Select Autodetect
 Employees (GeographyKey) should be selected
 Close
Note: Click on Relationships mode to check that relationships are connected.

(c) LearniT! 2016. All Rights Reserved. 34


www.learnit.com
Microsoft Power BI Essentials Training Guide

Creating Reports & Visualizations


Power BI provides more options for visuals than ever before. Beautiful charts and graphs
will enable you to create storylines, trends, charts, and high-level results. You can also
create your own custom visuals (slicers, charts, tables) that will be ready to use
whenever you need them.
Note: Power BI receives updates almost weekly, which means more and more new visuals.

Reports allow you to create stunning visuals to demonstrate what you want your data
to say. See below for a diagram of the Report features.

Report Mode

Field
wells

Stage

(c) LearniT! 2016. All Rights Reserved. 35


www.learnit.com
Microsoft Power BI Essentials Training Guide

Exercise: Compare GrossPay to the following data sets:

 Modes bar > select Report Mode


o Compare GROSS PAY to:
 Drag a field from one table and place it on the stage (see diagram)
o FIELDS > [Employees] > [GrossPay2013]
o Drag and drop [AverageStatePay] into staging area
o Drag and drop [LivingWage]

Note: Numerical fields will appear as a chart and alpha fields will appear in a list.

Changing Values in Visuals


Exercise: Change functions

 In the Value well, select the small down arrow to


change the aggregate
 Change from SUM to AVERAGE for the following:
o [GrossPay2013]
o [AverageStatePay] Fields
o [LivingWage]
Wells

(c) LearniT! 2016. All Rights Reserved. 36


www.learnit.com
Microsoft Power BI Essentials Training Guide

Formatting
Exercise: Format visual elements.

 FIELDS > Select “format” icon (looks like paint roller)


 Legend > Position: RIGHT (moves legend to right)
o Title > Title Text to: “Pay vs. State Pay vs. Living
Wage”
o Data colors: Choose different bar column
colors
o Border: turn “on”
 Select the Format icon to view the options for adding
chart elements, changing colors etc.

X and Y Axis—add labels to your chart. These labels


describe the chart columns. The top axis will insert category
labels on columns. The bottom axis will insert a numerical
scale to measure the columns by.

Data colors—customize the color assigned to columns.

Data labels—place value labels next to each column.

(c) LearniT! 2016. All Rights Reserved. 37


www.learnit.com
Microsoft Power BI Essentials Training Guide

Creating Visuals
There are many interesting visualizations available and Microsoft continues to provide
visualization updates almost weekly. By customizing visualizations, you can convey a
unique story to your audience.

Basic column chart


A standard column chart is effective in comparing numerical data across categories.

Fields Format

Exercise

 Insert a numeric field into the stage


 Drag a field that can be grouped to the axis area to insert more columns
 Drag a field to the Legend area to display categories by color

Gauge
Use a gauge visual to show a minimum, maximum or target value, and where you
currently are at.

Exercise

 Click on Gauge icon in Visuals Bar (ensure you are click in a blank space in
staging area before you select an icon, otherwise you will change the existing visual
that is selected).
 Add GrossPay2013 to the Value area of the stage
 Automatically, this chart will show your value as 50% of the gauge. However, you
can customize the size of the gauge.
 Target Value: Set the living wage to target value

 Set gauge axis bounds to:


o Min: 0

(c) LearniT! 2016. All Rights Reserved. 38


www.learnit.com
Microsoft Power BI Essentials Training Guide

o Max: 200,000,000

 Set a marker to point out the target (target is static).

Change the target

 Make the target a field of your data.


 Set the target to LivingWage

Change the target title

 Change the title to GrossPay2013 vs. LivingWage


 Change the color of the title
 Keep this chart on your report

Map
There are three kinds of map visuals. Maps use location information (i.e. states, cities,
latitude/longitude coordinates).
Note: This only works with an I nternet connection .

Exercise

 Click on Map icon in Visuals Bar

(c) LearniT! 2016. All Rights Reserved. 39


www.learnit.com
Microsoft Power BI Essentials Training Guide

 Drag Zip Code to Location well

Fields

 Drag and drop LivingWage into color saturation

Format

 Change the function of LivingWage to Average


 Change the data colors (saturation of the dots)
 Turn off the title

 Apply a border

(c) LearniT! 2016. All Rights Reserved. 40


www.learnit.com
Microsoft Power BI Essentials Training Guide

 Align the visuals according to this diagram:

Cards
Cards allow you to see the value of the aggregate and will display values.

Exercise

 Click on Card icon in Visuals Bar

 Insert three cards that show the average of the following:


o [GrossPay2013]
o [LivingWage]
o [LivingWage]
 Drag and drop field item into staging area
 FIELD > field well > choose AVERAGE
 Change the data label color

 Create two more cards:


o Average of AveStatePay
o Average of LivingWage

(c) LearniT! 2016. All Rights Reserved. 41


www.learnit.com
Microsoft Power BI Essentials Training Guide

Text boxes
Create text boxes to provide more information about what your dashboard is
displaying.

Exercise

 HOME > Text Box > type in the text box


 Add a title to this report

 Change the font format to:


o 54 pt font
o Bold

 Place the title in your report

(c) LearniT! 2016. All Rights Reserved. 42


www.learnit.com
Microsoft Power BI Essentials Training Guide

Slicers
Slicers are visual buttons that filter reports. For example, when you click on a slicer, the
visual will change and the entire report will also filter to reflect that change.
Note: A slicer will affect all visuals on your dashboard.

Exercise

 Click on Slicer icon in Visuals bar

 Drag and drop [State] into field well

Fields

 Change the orientation to horizontal so that the states show up like buttons next
to each other, instead of check boxes down a list
o Field > General well > Orientation > change to horizontal

Format

 Change the header


o Increase the size
o Change the color

(c) LearniT! 2016. All Rights Reserved. 43


www.learnit.com
Microsoft Power BI Essentials Training Guide

 Click on one of the states and see that the entire report changes to reflect the
values for that slice of the data.

NOTE: You may want to change the max to 20 million on the gauge chart. This will give you
a better visualization for the map when you apply a slicer.

(c) LearniT! 2016. All Rights Reserved. 44


www.learnit.com
Microsoft Power BI Essentials Training Guide

Shapes
Shapes are useful for creating borders around cards created on your dashboard.

 From the shapes command, choose rectangle

 Turn off the fill color of the rectangle

 Re-size the rectangle to surround the cards

Creating Filters
Apply a filter to the entire table by dragging a field to the Report Filter. Visuals will
update according to the filter applied.

Exercise

 Drag and drop a Field item into the Filter well


 Drag [State] into Filter well
 Use the filter options to view specific data

(c) LearniT! 2016. All Rights Reserved. 45


www.learnit.com
Microsoft Power BI Essentials Training Guide

Fields
Generally, fields that can be categorized should be placed in the Axis and Legend
areas. Fields that can be calculated should go in the Value area.

In the example below, there is a field in the Axis area, and


no field in the Legend area. This will produce Chart 1, shown
below. Reverse the fields to see Chart 2, below.

Lab 2: Creating Reports & Visuals

(c) LearniT! 2016. All Rights Reserved. 46


www.learnit.com
Microsoft Power BI Essentials Training Guide

(c) LearniT! 2016. All Rights Reserved. 47


www.learnit.com
Microsoft Power BI Essentials Training Guide

Day 2: Module 1
Data Modeling in Excel
Learning Objectives:
By the end of this module, you will be able to:

 Understand what a data model is and create one in Excel


 Create relationships across various data sets in Excel Power Pivot
 Create calculated columns, measures and hierarchies to organize your data
analysis in Excel Power Pivot

Opening Power Pivot


In 2016, Power Pivot is built into the Data tab, under the Data Tools group, and acts like
other data management features such as sorting and filtering. The command is called
Manage Data Model.

If Power Pivot does not show up in the ribbon:

 DATA tab > Manage Data Model

Creating Data Models in Power Pivot


Using the relational aspects of a database to analyze data.
Note: I f it is the first ti me you are creating a data mode l, you may see the message below.
Select Enable to continue:

(c) LearniT! 2016. All Rights Reserved. 48


www.learnit.com
Microsoft Power BI Essentials Training Guide

Retreiving external data from an Excel table


There are various ways to import data. In order to link data from Power Pivot to the
original source (no refreshing required), the data must be in an Excel file that is
connected to the data model.

Exercise: Query data from Stores.xlsx

 In Power Pivot window > HOME > From Other Sources

 Select Excel file > Next


 Browse: select “Stores.xlsx” > Open

 In the Table Import Wizard, make sure that Use first row as column headers is
checked off > NEXT
 Check off the Stores table

(c) LearniT! 2016. All Rights Reserved. 49


www.learnit.com
Microsoft Power BI Essentials Training Guide

 When you see “Success” window > click Close

Exercise

 Get External Data from [Geography] file


o HOME > From Other Sources
o Select Excel file > Next
o Browse: select [Geography.xlsx] > Open
o In the Table Import Wizard, make sure that Use first row as column headers
is checked off > NEXT
o Check off the [COMPLETED$] worksheet
o DO NOT click FINISH (continue to Sorting & Filtering below)

Sorting & filtering imported data


Use this to further refine import to work with only the data you are interested in
analyzing.

Exercise

 After selecting the table to import [COMPLETED$], in the Table Import Wizard, filter
the data by clicking on Preview and Filter

(c) LearniT! 2016. All Rights Reserved. 50


www.learnit.com
Microsoft Power BI Essentials Training Guide

 Uncheck the box next to the column headers that you don’t want to view. This
will filter this data out of the imported data. Columns to filter out should include:
o Locations
o Employees
o ProjectedEmpCount
o Average Revenue
o GeoCodes
o Projected Revenue
o Actual Revenue
o Difference
o % Difference

 Select OK to return to the Table Import Wizard > Finish


 When you are notified that the the import was successful, click Close
 Rename this table Geography just like you would rename a worksheet in Excel
(double click on worksheet tab)

Importing data from Access


Exercise

 In the Power Pivot Window, on the Home tab, click Get External Data > From
Database > From Access

(c) LearniT! 2016. All Rights Reserved. 51


www.learnit.com
Microsoft Power BI Essentials Training Guide

 Click Browse and locate the file: [ContosoData] > Open


 In the Table Import Wizard window, click Next
 Choose the option: Select from a list of tables….
 Click Next
 You don’t need to select all of the tables in the Access file. Select the following
tables:

o Channel
o Entity
o FactSales
o Product
o ProductCategory
o ProductSubcategory
o Promotion
 Follow the steps below to filter data imported from Access

(c) LearniT! 2016. All Rights Reserved. 52


www.learnit.com
Microsoft Power BI Essentials Training Guide

How to filter data imported from Access


Exercise

 Highlight ProductCategory > Preview & Filter and Select ProductCategoryKey in


the Table Import Wizard
 Deselect product categories 7 and 8

 Click OK > Finish (this will take a few moments and you will see Success Story
when completed)

Changing import choices


If you change your mind about the data
to import, you can modify the import
specifications. You do not have to start
importing from the beginning.

Exercise: Modify the table to change your


choice about which columns to import.

 Power Pivot window > Design tab >


Table Properties to modify the filters
you applied in a given table

(c) LearniT! 2016. All Rights Reserved. 53


www.learnit.com
Microsoft Power BI Essentials Training Guide

Change imported tables from an existing connection


You can change your mind about which tables to
import from a certain source. Avoid starting from
scratch by using the From Database command.

Exercise

 Power Pivot window > Home tab > Existing


Connections
 Access ContosoData > Open
 Select the table you forgot Promotion
 OK

From the resulting window, delete a connection, or


Open another table that you forgot to import
previously.

Exercise: Let’s say you forgot to import the


Promotion table from your Access file.

 Select Promotion table


 Click Open

Create a Power Pivot table


Now that you have imported all of the necessary data, you will be able to create a
Pivot Table that analyzes the data from the different tables and data sources.

Exercise: Create a Power Pivot table

 Power Pivot > HOME tab > Pivot Table > New Worksheet > OK

NOTE: I n Excel 2016, you can also create a Power Pivot Table from Excel’s original Pivot
Table command. I n the resulting dialogue box, choose Use this workbook’s Data Model .

(c) LearniT! 2016. All Rights Reserved. 54


www.learnit.com
Microsoft Power BI Essentials Training Guide

Exercise:

Analysis 1: Analyze the number of regions in each continent, from the Geography
table.

 Expand the Geography table in PivotTable Fields menu


 Rows: ContinentName [Geography]
 Value: Region [Geography]

Analysis 2: Analyze Sales by Continent.

Pull out existing VALUE: Region

 Collapse Geography
 Expand FactSales
 Place the following:
o Rows: ContinentName [Geography]
o Values: SalesQuantity [FactSales]
Note: Be aware that there is currently no existing relationship between Geography and
FactSales tables.

No Relationship = Big Problem!

(c) LearniT! 2016. All Rights Reserved. 55


www.learnit.com
Microsoft Power BI Essentials Training Guide

Create relationships
Creating relationships will allow you to connect similar data from different data sources
and unrelated tables.

 Power Pivot window > HOME > select Diagram View

 Drag and drop related fields on top of each other

Exercise: Create the following relationships:

Table Name Field Name


Stores Store Key
FactSales Store Key

Table Name Field Name


Stores GeographyKey
Geography GeographyKey

Table Name Field Name


Fact Sales PromotionKey
Promotion PromotionKey

(c) LearniT! 2016. All Rights Reserved. 56


www.learnit.com
Microsoft Power BI Essentials Training Guide

Now that you have the necessary relationships, the Pivot Table that you made earlier
should be accurately analyzing the data.

(c) LearniT! 2016. All Rights Reserved. 57


www.learnit.com
Microsoft Power BI Essentials Training Guide

Creating calculated columns in Excel


Let’s create a couple columns that will show us the TransactionCost and
TransactionSales.

Exercise: Create a Cost of Goods Sold in the FactSales worksheet

 Power Pivot window > HOME > Data View


 On the right, where you see an extra column named “Add Column” add the
following formulas below:

Note: To insert fields in the formula, either type in the field name OR click in the column
while typing out the formula.

= [UnitCost] * [SalesQuantity]
Name this column “COGS”

= [MSRP] * [SalesQuantity]

Name this column “SalesAmount”

= [MSRP] * [ReturnQuantity]
Name this column “ReturnAmount”

 Now create calculated columns that use the columns you just made
= [SalesAmount] – [COGS] – [ReturnAmount]
Name this column “Profit”

= [Profit] / [SalesAmount]
Name this column “ProfitMargin”

Note: Format this column as a percent (HOME > Format: Percentage)

(c) LearniT! 2016. All Rights Reserved. 58


www.learnit.com
Microsoft Power BI Essentials Training Guide

Create calculated columns using the RELATED function


The RELATED function allows us to retrieve information from a related table (like
VLOOKUP). Another reason to use the RELATED function is to create hierarchies.

= RELATED ( TableName [ColumnName] )

Exercise: Use the RELATED function to retrieve information.

 Start on the Product worksheet


 Power Pivot > HOME > Data View
 In a calculated column on the right side enter the following functions:
= RELATED (ProductCategory[ProductCategoryName])

 Name this column ”ProductCategory”

= RELATED (ProductSubcategory[ProductSubcategoryName] )

 Name this column ”ProductSubcategory”

Note: Calculated columns show up as a darker color. This helps distinguish between
imported data and custom data.

(c) LearniT! 2016. All Rights Reserved. 59


www.learnit.com
Microsoft Power BI Essentials Training Guide

Creating Hierarchies
We frequently want to apply the same analysis in multiple tables. Maybe you want to
be able to drill down into dates, or you want to see Products subdivided by the Regions
they are sold in. If you need these Pivot Table fields in the same order frequently, set up
a hierarchy.

Exercise: Create a hierarchy to view Products in a Pivot Table.

 Power Pivot > HOME > Diagram View


 Product Table > Hold down CTRL key and select the following fields
 in the “Dates” table:
o ProductCategory
o ProductSubCategory
o ProductName
 Right click and choose Create Hierarchy
 Double click on hierarchy name to rename it
“Products”
 Create a Pivot Table > notice that “Products” is the
only field that displays in the Product table.

(c) LearniT! 2016. All Rights Reserved. 60


www.learnit.com
Microsoft Power BI Essentials Training Guide

Ancestor & Derived Measures


Measures terminology
Aggregate measures—Measures by nature take
many numerical values and aggregate them into
a single value. This allows a single number to
summarize an entire field. This summary is what is Many Numbers
placed on the Pivot Table.

One Number

Ancestor Measures—Simple measures that only derive data from columns in a table.
Ancestor measures are foundation formulas (change this one and the derived
measures will update). Adjust one ancestor measure and the resulting measures update
immediately. See diagram below.

Derived measures—Measures that use measures in the calculation (more complex).

Ancestor
Measure
= Field + Field

Derived Derived
Measure Measure
= Measure + Measure = Measure + Measure

Derived Derived Derived


Measure
Compound Measure +
Measure
Compound Measure +
Measure
Compound Measure +
Compound Measure Compound Measure Compound Measure

(c) LearniT! 2016. All Rights Reserved. 61


www.learnit.com
Microsoft Power BI Essentials Training Guide

Creating measures in Power Pivot


 Use [Data Model] file > Power Pivot window > FactSales worksheet
 Create a TotalSales measure
o Click in the Calculation Area (outside of the table)
o Type in this calculation:
TotalSales: = SUM (FactSales [SalesAmount])
Note: The “columns” that appear in the Calculation
Area are in no way connected to the columns of the data. You
can create your measures in any “cell” you choose.

 The end result is an aggregate

Creating measures in Excel


 From the Power Pivot ribbon in
Excel > select Measures > New
Measure
 Fill out the following window (see
diagram below)
o Table name: FactSales
o Measure name: TotalProfit
o Formula: =SUM(FactSales[Profit])
 Additional features in this window include:
o Check formula – check for errors

Choose the Table

Name your Measure

Design your Measure

TotalProfit: = SUM (FactSales [Profit])

Format your Measure

(c) LearniT! 2016. All Rights Reserved. 62


www.learnit.com
Microsoft Power BI Essentials Training Guide

Note: User defined measures are known as Explicit Measures (i .e. Total Profit). I mplicit
Measures are built into Pivot Tables (i .e. Sum of Sales). When measures are explicit you can
do more.

When you’re making measures in Excel, ensure you select the correct table in the Measure
window.

DAX Expressions
DAX (data analysis expressions) can be used to define calculated columns in a table
and they can also be used to define measures.

COUNTROWS
COUNTROWS counts the number of records in a field
(rows in a table).

Create the following measure:

 Table: FactSales
 Measure Name: TotalTransactions
 Formula: =COUNTROWS(FactSales)
 Formatting Options: choose formatting (i.e.
number, decimal, no decimal place, use 1,000
separator)

DISTINCTCOUNT
DISTINCTCOUNT counts the number of unique records in a field. If the value shows up
twice, it will only be counted once.

Create the following measure:

 Table: FactSales
 Measure Name: DaysSelling
 Formula: =DISTINCTCOUNT(FactSales[DateKey])
 Formatting Options: choose formatting (i.e. number, decimal, no decimal place,
use 1,000 separator)

(c) LearniT! 2016. All Rights Reserved. 63


www.learnit.com
Microsoft Power BI Essentials Training Guide

Compound measures
A compound measure is made up of two or more other measurements. An example of
a compound measure is speed. Speed is a compound measure because it is
calculated from distance and time.

Create a compound measure:

 Table: FactSales
 Measure Name: Total Sales per Transaction
 Formula: = [TotalSales] / [TotalTransactions]
 Formatting options: currency

Note: To view all measures created and edit/delete/add new measures go to : Power Pivot
tab in Excel > Measures > Manage Measures .

(c) LearniT! 2016. All Rights Reserved. 64


www.learnit.com
Microsoft Power BI Essentials Training Guide

Create a second compound measure:

 Table: FactSales
 Measure Name: Sales per Day
 Formula: = [TotalSales] / [DaysSelling]
 Formatting options: currency

CALCULATE
CALCULATE function calculates a field with the measure you choose (i.e. SUM,
AVERAGE). CALCULATE allows a filter to be placed on the field before measuring it. You
can apply unlimited filters. (Think of CALCULATE like a SUMIF function).

CALCULATE Syntax

= CALCULATE ( FUNCTION ( Table[Column] ) , Table[Column] = ThingtoFilterFor )

If you have used a SUMIF, SUM IF


it compares like this…

CALCULATE using measures


If you’ve already created a measure that is adding up a field (i.e. TotalSales measure),
you can use that in the place of the (Function (Table[Column]) above.

CALCULATE Syntax

= CALCULATE ( [Measure] , Table[Column] = ThingtoFilterFor )

SUM IF

(c) LearniT! 2016. All Rights Reserved. 65


www.learnit.com
Microsoft Power BI Essentials Training Guide

Exercise: Create four CALCULATE measures to compare regular sales to promotion


sales. Use CALCULATE to find the sales only for items that do not have a promotion.

1. CALCULATE regular sales:

Power Pivot > Measures > New Measure

Table: FactSales
Measure Name: RegularSales
Formula: = CALCULATE ( [TotalSales] , FactSales[PromotionKey] = 1 )
Format options: currency

2. CALCULATE promotion sales:

Table: FactSales
Measure Name: PromoSales
Formula: = CALCULATE ( [TotalSales] , FactSales[PromotionKey] <> 1 )
Format options: currency

3. Create a measure to find percent of total regular sales:

Table: FactSales
Measure Name: % Sales Regular
Formula: = [RegularSales] / [TotalSales]
Format options > category > number
Format > percentage

4. Create a measure to find percent of total sales on promotions:

Table: FactSales
Measure Name: % Sales Promo
Formula: = [PromoSales] / [TotalSales]
Format options > category > number
Format > percentage

Lab 3: Measures in Excel

(c) LearniT! 2016. All Rights Reserved. 66


www.learnit.com
Microsoft Power BI Essentials Training Guide

Day 2: Module 2
Data Modelling in Power BI
Learning Objectives:
By the end of this module, you will be able to:

 Understand what a data model is and create one in Power BI


 Create relationships across various data sets in Power BI
 Create calculated columns, DAX measures and hierarchies to organize your
data analysis in Power BI

Importing a Data Model


If it’s your first time using Power BI, and you’ve already built a model in Excel, you’ll need
to get started by importing data. If you have been following along with this course, you
have already imported everything you will need. You will need to import [Data
Model.xlsx] into Power BI.

Exercise

 Open Power BI > skip the Start Screen

 FILE > Import > Excel Workbook Contents

 A message appears warning this may take a few moments

(c) LearniT! 2016. All Rights Reserved. 67


www.learnit.com
Microsoft Power BI Essentials Training Guide

 START
 A confirmation should appear that everything migrated over

Data Modelling Overview in Power BI


Data and Relationship modes are basically Power Pivot. Power BI has the same engine
as Power Pivot and they look the same.

Data mode
This is Power Pivot’s data view. See
all of the tables on the right-hand
side.

Add calculated Data Mode


columns and Relationships
measures by
right clicking on
any table (or field). You can also
click on the command in the ribbon
called New Measure.

Relationships mode
This is Power Pivot’s diagram
view. Create relationships
by clicking on dragging
fields.
Note: I t can be helpful to
visually resize tables to make
the more centralized tables
larger. I t helps conceptualize
the relationships.

(c) LearniT! 2016. All Rights Reserved. 68


www.learnit.com
Microsoft Power BI Essentials Training Guide

Creating Calculated Columns & Measures in Power BI


Creating calculated columns
Exercise

 Begin in the FactSales table


 Create a column for NetSales
 HOME > New Measure > New Column
 In the formula bar type the formula and name of column

DiscountPercent = RELATED (Promotion [DiscountPercent] )

DiscountAmount = RELATED (Promotion [DiscountPercent] ) * FactSales[DiscountQuantity]


* FactSales[MSRP]

% of TotalSale Discounted = FactSales[DiscountAmount] / FactSales[SalesAmount]

Creating measures
 MODELING tab > New Measure
o Or right click on FactSales table in right-hand side FIELDS list > New
Measure *make sure you right-click on the correct table )
 In the formula bar type the formula and name of column

TransactionCount = COUNT( FactSales [SalesAmount] )


Note: Counts the number of transactions made.

ReturnCount = CALCULATE( COUNT( FactSales [ReturnAmount] ),


FactSales[ReturnAmount] >0 )
Note: Counts the return amount I F the return amount is greater than zero.

% Transactions Returned = [ReturnCount] / [TransactionCount]


Note: Calculates the percent of transactions that were returned.

(c) LearniT! 2016. All Rights Reserved. 69


www.learnit.com
Microsoft Power BI Essentials Training Guide

Lab 4: Creating Reports

(c) LearniT! 2016. All Rights Reserved. 70


www.learnit.com
Microsoft Power BI Essentials Training Guide

Publish Online to the Power BI Service


Now that we’ve done all this designing, let’s share this information with our consumers.
In order to share it with anyone anywhere, first we’ll need to get it up on Power BI
Online.

 HOME tab > Publish

 Save file if you are prompted


 Click Sign in when prompted

 Select a destination > My Workspace > Select

When you see this window > click Got It

(c) LearniT! 2016. All Rights Reserved. 71


www.learnit.com
Microsoft Power BI Essentials Training Guide

Creating Dashboards
Dashboards are a high level analysis, or summaries, whereas reports perform a deep
dive into specific data. Dashboards contain important visuals from a variety of charts.

Pin tiles to dashboards


 Once you have published the visual to Power BI Online, select the visual to
create a tile for in the dashboard
 Click on the Pin icon

 Select New Dashboard


 Name Dashboard “Contoso Dashboard”
 Click on Pin
 Your new dashboard will show up with an asterisk (*) on the right-hand side next
to the name of the dashboard
 Select new dashboard to view it

(c) LearniT! 2016. All Rights Reserved. 72


www.learnit.com
Microsoft Power BI Essentials Training Guide

 Click and drag on dashboard corners to resize the visuals


 Pin more visuals and watch the dashboard grow

Note: Once you have published reports and da ta to Power BI Online, you cannot modify
the data in the online dashboard.

(c) LearniT! 2016. All Rights Reserved. 73


www.learnit.com
Microsoft Power BI Essentials Training Guide

Sharing Dashboards
Share dashboards with colleagues and allow anyone in your organization to view
reports and dashboards.

 Click on Share from the upper-right hand side of your window

 Type in the names of colleagues to share with


 Check or uncheck desired boxes
 Click Share
 The recipient will receive an email invitation

(c) LearniT! 2016. All Rights Reserved. 74


www.learnit.com
Microsoft Power BI Essentials Training Guide

Day 3: Module 3
Introduction to Calendar Tables & Time Intelligence

Learning Objectives:
By the end of this module, you will be able to:

 Understand what time intelligence is and how it works in Power BI


 Create Calendar Tables
 Become familiar with some introductory Time Intelligence DAX functions

Why Calendar Tables?


In order to utilize time intelligence, every data set must have a complete calendar. A
calendar table provides a standardized resource for time intelligence and makes it
much easier.

Criteria for creating Calendar Tables


Calendar tables must have the following properties:

 At least one column formatted with “date”


 Contains exactly one row per day
 Continuous rows of data (don’t skip weekends, even if business is closed)
 Calendar table must be related to your data table (e.g. FactSales)
 Contain columns for all of your desired groupings (e.g. MonthName)
 Ideally only spans the dates of your data

Ways to create a calendar


 Import from a database (if you have access to a database)
 Create in Excel (requires more work, and it can limit you in the future)
 Generate using Power Pivot engine
 Import from Azure DataMarket

(c) LearniT! 2016. All Rights Reserved. 75


www.learnit.com
Microsoft Power BI Essentials Training Guide

Creating a Calendar Table in Power BI


CALENDARAUTO
CALENDARAUTO function that builds a table of all the dates, one day at a time, based
on what is in your data model.

Exercise

 Add a new table: Modelling tab > New Table


 In the formula bar, type in:
DateKey = CALENDARAUTO()

 Press Enter

Note: This pulls all of the dates found in the entire data set, even
irrelevant dates and outliers such as sales dates from 2003.

CALENDAR
CALENDAR allows you to specific a start date and end date and provides the user
more control over the dates.
Note: You must use serial numbers to enter dates using the D ATE function.

CALENDAR function syntax:


= C ALEND AR ( St art Dat e , EndDat e )

Date function syntax :


=D ATE ( Year , MonthNumber, DayNumber )

 Type in the formula bar:


DateKey = CALENDAR ( DATE (2014,1,1), DATE(2016,12,31 ) )

 Press Enter

(c) LearniT! 2016. All Rights Reserved. 76


www.learnit.com
Microsoft Power BI Essentials Training Guide

DAX—Date & Time


DAX data and time functions allow you to create metadata, expanding the Calendar
Table by the types of fields you need to analyze (e.g. “MonthName,” “DayoftheWeek”).
You can use basic Time & Date functions to create these.

Exercise

 Switch back to Data mode


 Add a new column by either right-clicking on the Date table, or by clicking on
New Measure > New Column
 For each column, type in the following formula into the formula bar, and then
start another column for the next formula

Year = Year ( Dates [ DateKey ] )

MonthNum = Month ( Dates [ DateKey ] )

MonthName = Format ( Dates [ DateKey ] ), “MMM” )

MonthNameAbrv = Format ( Dates [ DateKey ] ), “MMM” )

DayofMonthNum = Day ( Dates [ DateKey ] )

DayName = Format ( Dates [ DateKey ] ), “DDDD” )

WeekdayNum = Weekday ( Dates [ DateKey ] )

DayName = Format ( Dates [ DateKey ] ), “DDDD” )

QuarterNum = ROUNDUP( MONTH( Dates [ DateKey ] )/3 , 0 )

QuarterName = CONCATENATE( “Qtr ” , Dates[QuarterNum] )

Month & Year = CONCATENATE( Dates[MonthNameAbrv]&“ “, Dates[Year] )

(c) LearniT! 2016. All Rights Reserved. 77


www.learnit.com
Microsoft Power BI Essentials Training Guide

Year & Month = Dates[Year]&Format(Dates[DateKey],”MM”)


Note: As a D AX, CONC ATEN ATE only accepts two arguments, which is why you must use “&”
to insert a space.

Connecting Dates to Data


Creating relationships
You must create relationships to connect the dates table to the rest of your data.

Exercise

 Click on Relationships mode


 Click and drag the DateKey field from the Dates table, to the FactSales table

Relationships

Creating reports using dates


Make a simple chart to display DATE and TIME data analysis.

Exercise: Make a simple chart that shows which month had the best sales:

 Click on Reports mode


 Drag and drop DATES(MonthName) onto staging area
 Drag and drop FactSales(TotalProfit) onto staging area table
 Convert table to visual by:
o Select table on staging area
o Select “Clustered Column Chart” visual
 Sort the chart: Largest to smallest
o Click on the three dots (…) in upper right corner of
chart
o Select Sort by Profit

(c) LearniT! 2016. All Rights Reserved. 78


www.learnit.com
Microsoft Power BI Essentials Training Guide

Note: Conducting the sort above does not sort chronologically


by month. Sorting by month name is only sorting alphabetically.

 Click on Data mode


 Choose the MonthName column

 Modeling tab > Sort by Column


 Sort by MonthNum

Introduction to Time Intelligence


These are a set of functions that understand dates. This section will focus on DATESYTD
(Year to Date).

DATESYTD
Exercise: Create a measure that CALCULATES TotalSales for the Year To Date

Show TotalSales by Month and show a running total of TotalSales for the year. Create a
measure that will allow you to include a running total (not a grand total) from the
beginning of the year.

 Click on Data mode


 Select FactSales table
 Insert a new measure
 Type in formula bar:

SalesYTD = CALCULATE ( [TotalSales] , DATESYTD ( Dates [DateKey] ) )

(c) LearniT! 2016. All Rights Reserved. 79


www.learnit.com
Microsoft Power BI Essentials Training Guide

Lab 5: Creating Calendar Tables

(c) LearniT! 2016. All Rights Reserved. 80


www.learnit.com
Microsoft Power BI Essentials Training Guide

Day 2: Module 4
Creating Dashboards
Learning Objectives:
By the end of this module, you will be able to:

 Understand the difference between reports and dashboards


 Know how to publish your data to Power BI Online
 Create stunning dashboards and share with your colleagues

What are Power BI Dashboards?


Dashboards are at the heart of Power BI. Dashboards allow you to monitor your most
important data, at a glance. A dashboard combines on-premises and cloud-born data
in a single window, providing a consolidated view of summarized data, no matter
where the data lives. Each metric, or insight, is displayed on the dashboard as a tile.

LABS
NOTES:

(c) LearniT! 2016. All Rights Reserved. 81


www.learnit.com
Microsoft Power BI Essentials Training Guide

LAB 1: Creating & Editing Queries


In this lab you will be re-issuing the queries from earlier, with one major difference: you
will not be loading them into tables. This time you’re going to “Load to Data Model”.
This process greatly reduces the size of your file.

Start with a blank Excel workbook

Import from an Excel file:


1. Excel > DATA > New Query > From File > From Workbook
2. Select the file called GeographyAsia
3. Click Load drop-down icon
4. “Load to…”
 Only Create Connection
 Add this data to the Data Model

Import from the other Excel files, using “Load to


Data Model”.

 GeographyEurope
 GeaographyNorthAmerica

Promote Headers
If the headers are named like “Column 1”, make
sure to “Use first row as headers”.

Append Tables
1. Excel > QUERY TOOLS > Append
2. Append GeographyAsia with GeographyEurope
3. Append the new query with GeographyNorthAmerica
4. Name this query AllRegions
5. Close and Load to Data Model

(c) LearniT! 2016. All Rights Reserved. 82


www.learnit.com
Microsoft Power BI Essentials Training Guide

Query Online Data


1. Excel > DATA > New Query > From Other Sources > From Web
2. Paste in the URL: http://blog.learnit.com/Files.powerbi.html
3. Select the table called Table0
4. Name this Query Continents
5. Close and Load to Data Model

Querying Text Files


1. Excel > DATA > New Query > From File > From Text
2. Select and Open the file called GeoCodesGeometry
3. You may need to “Use first row as headers”
4. Name this Query GeoCodes
5. Close and Load to Data Model

Referencing Queries
1. Select the Query called AllRegions
2. Excel > QUERY TOOLS > Reference

Merging Queries
3. Query Editor > HOME > Merge Queries
4. Merge the query named AllRegions with the query named Continents
5. Select the columns on each table called ContinentID
6. Click OK
7. Select the resulting column in the Query Editor
8. Query Editor > TRANSFORM > Expand
9. Choose the column ColumnName
10. Click OK
11. Name this Query Merged
12. Close and Load to Data Model

Reference the Query called Merged


1. Select the query called Merged
2. Right-click and choose “Reference”
3. Name this new query Normalized

Replace Values
1. Select the column called State, Region
2. Query Editor > HOME > Replace Values
3. Replace all semi-colons with commas
4. Click OK

(c) LearniT! 2016. All Rights Reserved. 83


www.learnit.com
Microsoft Power BI Essentials Training Guide

Split Columns
1. Select the column called State, Region
2. Query Editor > TRANSFORM > Split Column
3. Select the drop-down menu, and choose “Custom”
4. Enter “ – “ as the custom delimiter.
5. Rename the columns, “State” and “Region” respectively

Remove Columns / Blank Rows


1. Remove the column called “Status”
2. Remove the column called “Actual”
3. Remove the column called “Column 18”
4. Query Editor > HOME > Remove rows > remove blank rows

Converting Data Types


Convert the following columns to their corresponding data types using the command
on Query Editor > HOME > Transform > Data Type

Whole number
 Locations
 Employees

Date
 LoadDate
 UpdateDate

Currency
 Projected Revenue
 Actual revenue
 Difference

Decimal Number (there is no percent option)


 % Difference

Merge Columns
1. Select the columns called Loc2 and Loc5
2. Query Editor > TRANSFORM > Merge Columns
3. Name this column GeoCodes
4. Click OK

(c) LearniT! 2016. All Rights Reserved. 84


www.learnit.com
Microsoft Power BI Essentials Training Guide

Adding Custom Columns


1. Query Editor > ADD COLUMN > Add Custom Column
2. Name this column ProjectedEmployees
3. Type in the formula window:

= [Employees] * 1.15

4. Click OK
5. Format this column as a Whole Number
6. Close and Load to Data Model

Observe the difference in file size


The difference in file size is profound. This will make a large impact on performance as
well.

(c) LearniT! 2016. All Rights Reserved. 85


www.learnit.com
Microsoft Power BI Essentials Training Guide

LAB 2: Creating Reports & Visuals


Lab 2A: Revenue – Actual vs. Projected
For this first lab, we’re going to be using data only from the Geography table.

The first report will


compare Projected
Revenues to the
Actual Revenues.

Report Level filter for the United States


Place the Region field in the Report Level filter. Then filter for the United States.

(c) LearniT! 2016. All Rights Reserved. 86


www.learnit.com
Microsoft Power BI Essentials Training Guide

Make 2 cards
Make it easy for your audience to understand the main point: how much over (or
under) the projection were the actual sales?

Use the following fields, and apply the Card style visual.

 Difference (SUM)
 % Difference (AVERAGE)

For each card

1. Turn off the Category label


2. Turn on the Title
3. Give it a title
 Sales Over Projection
 Percent Over Projection
4. Give the title a color
5. Change title font to 14
6. Center the title
7. Apply a Border (light grey)

(c) LearniT! 2016. All Rights Reserved. 87


www.learnit.com
Microsoft Power BI Essentials Training Guide

Make a Clustered Bar Chart

Field Placement
Axis State

Value Difference

Color Saturation Difference

Sort the chart By Difference

Change the Data Colors


1. Turn on “Diverging” to get a 3 color spectrum

2. Change the Minimum to red


3. Change the Center to grey
4. Maximum should be blue

5. Minimum value is -1,000,000


6. Center is 100000
7. Maximum is 8000000

Change Title to “Sales Over Projection”

(c) LearniT! 2016. All Rights Reserved. 88


www.learnit.com
Microsoft Power BI Essentials Training Guide

Make a Clustered Column Chart

Field Placement
Axis State

Value Projected Revenue


Actual Revenue

Change Data Colors


Change the colors to whatever you’d like

Change the title to “Projection vs. Actual by State”

Start placing your visual items where you’d like.

(c) LearniT! 2016. All Rights Reserved. 89


www.learnit.com
Microsoft Power BI Essentials Training Guide

Create a Scatter (Bubble) Chart

Field Placement
Details State

X Axis % Difference (AVERAGE)

Y Axis Actual Revenue (SUM)

Size Projected Revenue

Note that Scatter charts are charts with 2D data (X and Y Axis fields)
where as Bubble charts have a 3rd dimension of values that change the bublle size
(Projected Revenue)

Change the title to “Actual Revenue, % Over Projection”

Turn on Category Labels

Data Colors
Change the default color.

If desired, recolor some of the outliers another color. But it is also


advisable to use the built in feature on the Fields pane (Color
Saturation) to automate this for future data.

(c) LearniT! 2016. All Rights Reserved. 90


www.learnit.com
Microsoft Power BI Essentials Training Guide

Create a Shape Map

Field Placement
Location State

Color Saturation Difference

Turn off the Title

Data Colors
1. Diverging On

2. Minimum Red
3. Center White
4. Maximum Blue

5. Minimum -1000000
6. Center 0
7. Maximum 8000000

(c) LearniT! 2016. All Rights Reserved. 91


www.learnit.com
Microsoft Power BI Essentials Training Guide

Lab 2B: Wage vs. Revenue Comparison


Note: use fields from both tables

The second
report will
compare
wages to
revenues to
see if there is
any
correlation, or
insights we
can gain.

Report Level filter for the United States


Grab the Region field and place it in the Report Level filter. Then filter for
the Unites States.

(c) LearniT! 2016. All Rights Reserved. 92


www.learnit.com
Microsoft Power BI Essentials Training Guide

Make 2 cards
Make it easy for the audience to understand the main point: how much over (or under)
the projection were the actual sales?

Use the following fields, and apply the Card style visual.

 GrossPay2013 (SUM) – Employees table


 ActualRevenue (SUM) – Geography table

For each card

1. Change the Data Label Color


2. Apply a Border (light grey)

Make a Donut Chart

Field Placement
Values Actual Revenue (Geography table)
GrossPay2013 (Employees table)

Change the Data Colors


 Actual Revenue Red
 GrossPay2013 Blue

(c) LearniT! 2016. All Rights Reserved. 93


www.learnit.com
Microsoft Power BI Essentials Training Guide

Line and Clustered Column Chart

Field Placement
Shared Axis State (Employees table)

Column values GrossPay2013 (Employees table)


AveStatePay (Employees table)

Line values Actual Revenue

Sort by
GrossPay2013

(c) LearniT! 2016. All Rights Reserved. 94


www.learnit.com
Microsoft Power BI Essentials Training Guide

Add a Matrix table


This is the closest thing we have to a Pivot
Table in Power BI

Field Placement
Rows State (Employees table)

Values AveStatePay (Employees table)


Projected Revenue (Geography table)
Actual Revenue (Geography table)
EmpID (Employees table)

Matrix Style
Try a few, choose which ever one you like best.

Add a slicer

Field Placement
Field State

Resize the slicer, making it tall and narrow so that it will fit on the left side of the report.

(c) LearniT! 2016. All Rights Reserved. 95


www.learnit.com
Microsoft Power BI Essentials Training Guide

Lab
Create at least one additional report, analysis suggestions include:

Profit
 Which product categories have the highest profit margins? Which product
generate the most dollars in profit? What correlations can be drawn here?
 Compare Profit in each month by category. What conclusions can you draw?
 Compare this to the sales in each month by category. What conclusions can you
draw here?

Refunds
 What portion of total sales is refunded?
 Which Product Category has the most refunds? The highest refund amount? The
highest refund:sales ratio?
 What time of year brings in the most refunds? Is there any correlation between
promotions being run and refunds?

Sales & Transactions


 Which days typically have the highest number of transactions? Which days have
the highest sales typically?
 Are the monthly sales trends consistent each year? Which months sell the best?
How does this compare to the promotions being offered at the time?
 Which Product Category is been declining in sales? Which has been steady?

Locations
 Which locations have been selling the best?
 Which locations have the highest refunds?
 Which locations have the highest profit margin?
 Which locations have the most transactions?
 Transaction to profit ratio?

(c) LearniT! 2016. All Rights Reserved. 96


www.learnit.com
Microsoft Power BI Essentials Training Guide

LAB 3: Measures and DAX


Let’s analyze our Returns. We want to determine our Net Sales, and the percent of our
Total Sales that were refunded, and what percent were not refunded.

You will be creating measures that accomplish the


following:
1. Aggregate Refunds (SUM RefundAmount)
2. Get Net Sales (Total Sales – Refunds)
3. Get Percent of Total Sales that was refunded
4. Get Percent of Total Transactions that were refunded

REFUNDS Measure
Table: FactSales
Measure Name: Refunds
Formula: = SUM ( FactSales[ReturnAmount] )
Format: Currency

NETSALES Measure
Table: FactSales
Measure Name: NetSales
Formula: = [TotalSales] - [Refunds]
Format: Currency

PERCENT REFUNDS of SALES Measure


Table: FactSales
Measure Name: % TotalSales Refunded
Formula: = [Refunds] / [TotalSales]
Format: Percent

(c) LearniT! 2016. All Rights Reserved. 97


www.learnit.com
Microsoft Power BI Essentials Training Guide

PERCENT TRANSACTIONS REFUNDED Measure


Table: FactSales
Measure Name: % Transactions Refunded
Formula: = CALCULATE ( COUNT ( FactSales[ReturnAmount] ) , FactSales[ReturnAmount]
>0) / COUNT ( FactSales[ReturnAmount])
Format: Percent

This last example is one in which the user has decided not to create individual ancestor
measures first.

How could you change this measure to a derived measure? (Create


ancestors)

(c) LearniT! 2016. All Rights Reserved. 98


www.learnit.com
Microsoft Power BI Essentials Training Guide

LAB 4 – Creating Reports


Make some measures for PromoSales, and Refunds. Then build reports for each one.

Lab 4A – Promotion and Regular Sales Comparison


We want to know how our Discounts contribute to Sales. And we want to know how the
discount values compare to the sales generated by that promotion. This is how it will
look.

Make some measures:


We haven’t made a measure for the total
dollar amount of the discounts. So let’s do that
first.

Then let’s make a measure that compares


Total Sales on Promo to the value of the
discounts.

And finally we’ll need to make


a measure for PromoSalesYTD.

(c) LearniT! 2016. All Rights Reserved. 99


www.learnit.com
Microsoft Power BI Essentials Training Guide

100% Stacked Column Chart

Fields

Axis: MonthName

Value: RegularSales

PromoSales

Tooltips: RegularSales

PromoSales

PromoSalesYTD

DiscountAmount

Cards & Slicers


Just choose the field
displayed on the
slicer or the Card

Promo Sales

Discount Amount

% of Total Sales
Discounted
(Average)

(c) LearniT! 2016. All Rights Reserved. 100


www.learnit.com
Microsoft Power BI Essentials Training Guide

Matrix Table

Fields

Field
Rows: MonthName

Columns: Year

Values: PromoSales
PromoSalesYTD
Format

Format

Matrix Style: Style: Flashy Rows

Grand Tota: Font Color: White

Note: As of the creation of this guide, the ability to turn off


Grand Totals has a bug, so we turn them white.

Pie Chart & Donut Chart


These are easy. Each one only has values. And the values are
displayed below as the data labels.

(c) LearniT! 2016. All Rights Reserved. 101


www.learnit.com
Microsoft Power BI Essentials Training Guide

Lab 4B
Create at least one additional report, analysis suggestions include:

Profit
 Which product categories have the highest profit margins? Which product
generate the most dollars in profit? What correlations can be drawn here?
 Compare Profit in each month by category. What conclusions can you draw?
 Compare this to the sales in each month by category. What conclusions can you
draw here?

Refunds
 What portion of total sales is refunded?
 Which Product Category has the most refunds? The highest refund amount? The
highest refund:sales ratio?
 What time of year brings in the most refunds? Is there any correlation between
promotions being run and refunds?

Sales & Transactions


 Which days typically have the highest number of transactions? Which days have
the highest sales typically?
 Are the monthly sales trends consistent each year? Which months sell the best?
How does this compare to the promotions being offered at the time?
 Which Product Category is been declining in sales? Which has been steady?

Locations
 Which locations have been selling the best?
 Which locations have the highest refunds?
 Which locations have the highest profit margin?
 Which locations have the most transactions?
 Transaction to profit ratio?

(c) LearniT! 2016. All Rights Reserved. 102


www.learnit.com