PBI Desktop Fundamentals Training Session 1
PBI Desktop Fundamentals Training Session 1
1
TRAINING STRUCTURE
Power BI and Power Pivot in Excel are built on the exact same engine
Expect familiar contents if you’re already comfortable with Power Query and data modeling fundamentals
EXCEL POWER BI
Excel and Power BI are built
PivotTable Report View on top of the same engine
s Data
Shaping • Power BI takes the same data
(Power shaping, modeling and analytics
Query) capabilities and adds new
Custom reporting and publishing tools
Data Visualization Tools
PivotCharts Modeling (R-Visuals, Bookmarks, • Transitioning is easy; you can
(Power Interactions, etc) import an entire data model
Pivot) directly from Excel
Calculated
Power Map/ Fields Publishing &
Power View (DAX) Collaboration Options
(Power BI Service)
THE POWER BI INTERFACE
Three Cores:
Filter,
Visualization
Report
and Data
Fields Tools
Data
Relationships
(Model)
THE POWER BI WORKFLOW
HOME*:
Home tools are split across
Home & Insert
INSERT:
MODELING:
COLUMN TOOLS:
Access column attributes, set
data types and formats, use
sorting and grouping tools, etc.
MEASURE TOOLS:
Access measure attributes,
determine home table, set
formats and categories, etc.
CONNECTING & SHAPING DATA
TYPES OF DATA CONNECTORS
Formula Bar
M Code
Table Name
& Properties
Query
Applied Steps
Pane
QUERY EDITING TOOLS
The HOME tab includes general settings and common table transformation tools
The TRANSFORM tab includes tools to modify existing columns (splitting/grouping, transposing, extracting text, etc)
The ADD COLUMN tools create new columns (based on conditional rules, text operations, calculations, dates, etc)
BASIC TABLE TRANSFORMATIONS
Change data type (date, $, percentages)
Promote
header row
Remove unnecessary
columns
Calculate a new
column DiscountPrice
as formatted using
Add column –
Standard - Multiply
DATE-SPECIFIC TOOLS
Date & Time tools are relatively straight-forward, and include the following options:
• Age: Difference between the current time and the date in each row
• Date Only: Removes the time component of a date/time field
• Year/Month/Quarter/Week/Day: Extracts individual components from a date field
(Time-specific options include Hour, Minute, Second, etc.)
• Earliest/Latest: Evaluates the earliest or latest date from a column as a single value
(can
only be accessed from the “Transform” menu)
Note: You will almost always want to perform these operations from the “Add Column” menu
to
build out new fields, rather than transforming an individual date/time column
Practice – Date Tools
Connect the
Customers CSV
File to Power BI
NOTE: Any fields not specified in the Group By settings are lost
GROUPING & AGGREGATING DATA
(ADVANCED)
This time we’re transforming the daily, transaction-level table into a summary
of “TotalQuantity” aggregated by both “ProductKey” and “CustomerKey”
(using the advanced option in the dialog box)
Group by
ProductKey and
CustomerKey to
create new Total
Quantity column
MERGING QUERIES
Use the “Folder” option (Get Data > More > Folder) to append all files within a folder (assuming they share
the same structure); as you add new files, simply refresh the query and they will automatically append.
Practice – Appending Queries from Folder
1) From within the Data view, right-click a field 2) This creates a hierarchy field 3) Right-click other fields
(or click the ellipsis) and select “New hierarchy” containing “Start of Year”, which (like “Start of Month”) and
we’ve renamed “Date Hierarchy” select “Add to Hierarchy”
Practice – Creating Hierarchy
Creating Territory Hierarchy
by Continent – Country -
Region
BEST PRACTICES: CONNECTING & SHAPING
DATA
Get yourself organized, before loading the data into Power BI
Define clear and intuitive table names from the start; updating them later can be a headache, especially
if you’ve referenced them in multiple places
Establish a file/folder structure that makes sense from the start, to avoid having to modify data source
settings if file names or locations change
There’s no need to constantly refresh sources that don’t update frequently (or at all), like lookups or
static data tables; only enable refresh for tables that will be changing
When working with large tables, only load the data you need
Don’t include hourly data when you only need daily, or product-level transactions when you only care
about store-level performance; extra data will only slow you down
CREATING A DATA MODEL
WHAT’S A “DATA
MODEL”?
Understand the
differences
between matrix
after a Data
Model is created
and the one
without
TIP: In a normalized database, each table should serve a distinct and specific purpose (product
information, dates, transaction records, customer attributes, etc.)
This Calendar Lookup table provides additional attributes about each date (month, year, weekday, quarter, etc.)
This Product Lookup table provides additional attributes about each product (brand, product name, sku, price, etc.)
These columns are foreign keys; they These columns are primary keys; they uniquely identify each
contain multiple instances of each row of a table, and match the foreign keys in related data tables
value, and are used to match the
primary keys in related lookup tables
Practice – Arrange and Define Data, Lookup tables; Primary, Foreign keys
Arrange the tables
in Relationship
view and try to
define primary,
foreign keys
RELATIONSHIPS VS. MERGED TABLES
Can I just merge queries or use LOOKUP or RELATED functions to pull those attributes into the
fact table itself, so that I have everything in one place?
Original Fact Table fields Attributes from Calendar Lookup table Attributes from Product Lookup table
The Sales_Data table can connect to Products using the ProductKey field, but
cannot connect directly to the Subcategories or Categories tables
TIP:
Models with chains of dimension tables are often called “snowflake” schemas
(whereas “star” schemas usually have individual lookup tables surrounding a
central data table)
Practice – Create a Snowflake Schema
Create a Snowflake
Schema from the
relationships between
Sales and Product
categories in
Relationship view
MANAGING & EDITING RELATIONSHIPS
The “Manage Relationships” dialog box allows Editing tools allow you to activate/deactivate relationships, view
you to add, edit, or delete table relationships cardinality, and modify the cross filter direction (stay tuned!)
Practice – Edit a Relationship
Try editing a
wrelationship from
OrderDate to
StockDate and back
(between Sales and
Date tables)
ACTIVE VS. INACTIVE RELATIONSHIPS
The Sales_Data table contains two date fields (OrderDate & StockDate), but
there can only be one active relationship to the Date field in the Calendar table
Double-click the relationship line, and check the “Make this relationship
active”
box to toggle (note that you have to deactivate one in order to activate
another)
RELATIONSHIP CARDINALITY
In this case, there is only ONE instance of each ProductKey in the Products
table (noted by the “1”), since each row contains attributes of a single product
(Name, SKU, Description, Retail Price, etc)
There are MANY instances of each ProductKey in the Sales_Data table (noted
by the asterisk *), since there are multiple sales associated with each product
CARDINALITY to Avoid: MANY-TO-MANY
• Connecting the two tables above using the product_id field creates a one-to-one relationship,
since each ID only appears once in each table
• Unlike many-to-many, there is nothing illegal about this relationship; it’s just inefficient
TIP:
Arrange your lookup tables above your data tables in your model as a
visual reminder that filters flow “downstream”
TWO-WAY FILTERS