1. power_bi
1. power_bi
CHAPTER-1
Introduction To Power BI
Learning objectives
Understand Power BI's role-specific benefits.
Create a report and dashboard.
Explore role-based features.
Collaborate and share reports.
See real-world role customization examples.
Is Excel enough for
Data Analytics?
We CAs use Excel predominantly for data analysis.
When it comes for enterprise data Excel is having the following
limitations:
Row limitation of 1048576 rows.
Pivot Table can handle only a single flat table.
Data visualization is not effective and synchronised or at
least not interactive to each other.
Data from multiple sources cannot be imported (like
json, pdf etc.).
OLAP and Data Modelling requires Robust Columnar
Databases for optimizing the performance of reporting.
Need for a Tool like
Power BI
Increasing Business Challenges
Availability of Data Online
Multidimensional approach –
Data Cube Automate
d
Accurate
Online Analytical Processing
Possibility of Data Driven Decision
Making
Decision Making
Handling Big Data Integrate
d
Data
driven
Continuous Monitoring of KPIs
Intelligent
Elements of Power BI
Power BI Desktop (Free) –
Used by Developers of Power
BI Reports
Power BI Service – Online
SaaS – a web service to share
Reports
Power BI Apps - available on
phones and tablets.
Power BI Capabilities
Capacities – Set of Resources to share
content Reports
Data
OLAP
Modelling
Power Visualizati
Query on
• Extract • DAX
• Transform • Interactive
• Load Visuals
• M Language
Other Related Concepts
Columnar Databases
SQL & NoSQL
Data Flow
Filter Context
Row Evaluation Context
Context Transition
Data Cube Operations
Power BI Reporting
Pin visuals
Build
Data sets to
Report
Dashboard
Report
Transform Load Consumptio
n
UNIT-1: MS POWER BI
CHAPTER-2 Connecting to
Data Sources
Learning Objective
Explore the data-centric features and tools
of Power BI.
Explore ways to find data.
Getting Ready …
Download Power BI Desktop (free from Microsoft
Website)
https://powerbi.microsoft.com/en-us/downloads/
Sign-in to Power BI Service
Launch Power BI Desktop
Three major views of Power BI Desktop
Report View (Default)
Data View
Model View
Get familiar with the
interface
Ribbon
Report View or Canvas
Page Tab
Panes
Layout
Power BI Workflow
Report
Consumptio
Publish to n
PBI Service
Create and
Data Connect
Modelling Visuals
ETL & Creating
Measures
Data
Source
Data Preparation and
Process
Need for ETL
Data coming from different sources like Text, CSV, XML,
JSON, PDF, ODBC, Web, Cloud, Dataverse, Big Data, Images
etc.,
Clean and standardize the data to integrate with multiple
sources
Moving from Entity Centred approach to Fact Centred
approach
In RDBMS > Entity in the centre Attributes in the
surrounding
In OLAP > Fact in the centre, Dimensions in the
surrounding
Load only the data relevant for the reports to optimize space
What is ETL?
ETL stands Data Data Data Loading Data Quality Metadata Data
for Extract – Extraction Transformati Assurance Management Governance
Transform – on and Security
Load
Full or incremental Convert data into a Loading Handling Managing Ensuring
extraction format that is transformed data exceptions and metadata to track compliance with
methods used to compatible with into the data errors encountered data lineage, data governance
get the required the schema. model. during the ETL transformations, policies and
data. Applying business process. and dependencies. regulations.
Ensuring data rules, data Data profiling and Documentation of Implementing data
quality and validation, and cleansing to ETL processes and security measures
consistency during data enrichment improve data data mappings for during the ETL and
the extraction processes quality before transparency and entire reporting
phase. loading. governance. process.
Role-based access
controls for
sensitive data
handling.
ETL IN POWER BI
CHAPTER-3.1
Querying and Shaping the
Data
LEARNING OBJECTIVES:
Identify and connect to a data source
Get data from a relational database, such as
Microsoft SQL Server
Get data from a file, such as Microsoft Excel
Get data from applications
Get data from Azure Analysis Services
Select a storage mode
Fix performance issues
Resolve data import errors
Get data from multiple
sources
An organization may have data in multiple sources,
but they are related. Getting the data into Power
Query is the first step.
Get data from Flat Files
Flat files are individual data files.
Data from external sources may also be required for
analysis (like) GST/Bank account data for
reconciliation)
These files are usually in one of the following formats.
Txt (Fixed width)
Csv (Delimited)
XLSX (Excel Files)
XML (Tree Structure Data)
PDF (Portable Document Format)
Json (Nested Tables/Key Value pairs)
Get data from Flat
Files … Contd.
Flat files may be in
Local drives
OneDrive for Business
OneDrive Personal
Sharepoint Folder
Data source can be changed later by clicking Home-
>Transform Data-> Data Source Settings
Make sure the same structure of the data is being
loaded every time.
Get data from
RDBMS
Transaction data of an organization (like
a typical ERP) is stored mainly in RDBMS.
Power BI can connect any RDBMS data
as source of data using specific
database-oriented connector or through
ODBC (Open DataBase Connectivity)
Example, Tally data can be connected
through TallyODBC.
Get data from RDBMS
First connect to the RDBMS Server using Data connectors
Two ways to get data from RDBMS
Selecting required individual tables
Running a customized query
Dynamic Reports with
Parameters
Dynamic Reports can be created by passing
Parameters to SQL Queries
Steps to be followed:
Create a query with parameter
Create a Parameter (Home->Manage Parameters-
>New Parameter)
Convert the Query to a Function (Right Click Query-
>Create Function)
In any other query having the parameters as a
column, Add a Column by Invoking Custom Function
Dynamic Reports with
Parameters
Step 1 Step 2
Dynamic Reports with
Parameters
Step Step 4
3
Get Data from NoSQL (Not
only SQL) Database
Data can be extracted from NoSQL Databases like Azure
Cosmos DB.
JSON DOCUMENTS
In NoSQL
databases,
data is stored
in the form of
JSON
documents
which can be
easily
extracted into
Power Query
Editor
By pressing
Expand button
we can extract
Get Data from Online Services
Data can be downloaded from online services like
SharePoint, OneDrive, Google Analytics, Dynamics
365 etc.,
Storage Modes
Data can be stored in three modes in Power BI
Services
Import Mode (Create a local copy of data)
Direct Query (Make a query whenever required)
Used for viewing the most up-to-date data
Dual (Composite of above two)
Some part is copied
Balance is queried
Get data from Azure
Analysis Services
Azure Analysis Services is a fully managed platform
as a service (PaaS) that provides enterprise-grade
data models in the cloud.
Create a Semantic Model to perform ad hoc data
analysis
Fix Performance
Issues
Use Performance Analyzer to fix tune
performance issues.
To optimize the performance use
performance tuning techniques
Index Creation
Hardware Upgrades
Query Execution Plan Tuning
Data Compression etc.,
Fix Performance
Issues
Query Folding
A method used by the Power Query
Editor to convert internally Power Query
steps to Native SQL Query.
Useful only for SQL Query connectors
and not flat file connectors.
If Query Folding is possible, View Native
Query option will be enabled.
The idea is to run the steps in SQL
server itself if possible, instead of
running the steps by Power Query.
Query Diagnostics
• This tool is useful when you
want to analyse
performance on the Power
Query side for tasks such as
loading datasets, running
data refreshes, or running
other transformative tasks.
Optimize Performance
Process as much possible in the native source itself
instead of Power Query
Instead of CTE (Common Table Expressions) or Stored
Procedures, use Native SQL Queries.
Column separation like Date and Time into two
columns can be done in the source itself.
Resolve Data Import
Errors
Common Errors
Query Timeout Expired
Couldn’t find data formatted as table (in
Excel files)
Couldn’t find file
Data Type mismatch errors
Date format errors (importing US date
format (mm/dd/yyyy) in Indian date format
(dd/mm/yyyy) without using locale.
These errors can be resolved if we properly
follow the help and documents.
UNIT-1: MS Power BI
CHAPTER-3.2
Clean, Transform, and Load
Data in Power Bi
Learning objectives
Resolve inconsistencies, unexpected or null
values, and data quality issues.
Apply user-friendly value replacements.
Profile data so you can learn more about a
specific column before using it.
Evaluate and transform column data types.
Apply data shape transformations to table
structures.
Combine queries.
Apply user-friendly naming conventions to
columns and queries.
Edit M code in the Advanced Editor.
Clean, Prepare and
Process the data
Cleaning the data is a challenging task for the data analyst since
Garbage In is Garbage Out.
We need to systematically treat
Null values
Duplicates
Multiple column values in a single column like address
containing PIN code, City, State etc.,
Blank Rows/Columns etc.,
Identify Columns and
Names
From the chunk of data imported (especially if it is not
from structured data) we need to identify columns and
names.
Promote the column headers when needed
Clean, Prepare and
Process Data
Power Query is having transformation
tools like
Remove Top Rows, Blanks
Keep Rows
Remove Duplicates
Remove Columns
Choose Columns
Transpose
Pivot
Unpivot
Parse
Split
Unpivot Columns
Unpivot is an important feature in
Power Query Editor
Data before Unpivot Data after Unpivot
Replace Values
Replace any value with any value even in multiple columns
together is a handy tool
Remove Duplicates
Duplicates can be removed either
for a single column or multiple
columns together.
Change Column Types
Choose appropriate column types to make the reports
accurate.
Date formatted as Text Date formatted as Date
Full Outer
Column Profile
Distribution &
Quality
Column Profile
Helpful to find nuances of
data
Anomalies
Outliers
Unique and Distinct
Count
Column Distribution
View of value distribution
of all the columns
Column Quality
Composition of valid,
error, empty data column
wise.
Use Advanced Editor to
modify M Code
Each time you shape data in Power Query, you create
a step in the Power Query process.
It is rarely used.
Sometimes easy to modify M Code directly.
View->Advanced Editor will show the M Code for the
current query.
UNIT-1: MS POWER BI
CHAPTER-4
Data Visualizations and
Data Extractions
LEARNING OBJECTIVES:
Explore Power BI Visuals
Create Power BI Visuals
Create and import a custom report theme.
Create custom visuals with R or Python.
Enable personalized visuals in a report.
Review report performance using Performance
Analyzer.
Design and configure Power BI reports for
accessibility.
Introduction to Power
BI Visuals
“A picture is worth a thousand words”
Complex data can be depicted in a simple
visual.
X1 Y1 X2 Y2 X3 Y3 X4 Y4
Load and
Save Power Data Data
Transform
BI File Refresh modelling
data
Create Publish to
Data
Visualizatio Power BI
Security
ns Service
UNIT-1: MS Power BI
CHAPTER-5
Creating Reports and
Output Options
Learning objectives
Create a report in Power BI
Share Power BI reports in various formats
Power BI Reports
Output Options
The main purpose of Power BI Software is to provide right
information to the right person at the right time to take data
driven decision making.
Power BI Reports can be shared in many ways.
The common way to share a report of an Enterprise is Publishing
to Web service.
Browser or even mobile is enough to consume the reports.
Collaboration and sharing of reports
Automatic refreshing of data
Secured access to reports.
Export to PDF
Power BI Reports can be exported to a Static PDF file.
To export to PDF, go to "File" > "Export" > "PDF."
Export to PowerPoint
From online service we can export to PowerPoint presentation.
In PowerPoint there is a Power BI Add-in to showcase any
Power BI Report.
Export data to Excel
Every visual is having the feature to export the underlying data
as a csv file and can be imported into Excel for further analysis
easily.
Email Subscription
Users can get report updates in email if subscribed to Email
subscription service of Power BI
Print Report Pages
Any report page can be printed from online services
directly.
Power BI Embedded
Power BI Reports can be embedded and integrated into any
web page or portal using Azure resources.
This may be useful for having a wider reach.
TH A N
K
YO U