Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

POWER BI

_________________________________________________________________________
UNIT 1: Get Started with Power Bi

Different Types of Data Analysis:

 Descriptive: what has happened based on historical data.


 Diagnostic: Why Events happened.
 Predictive: What will happened in future.
 Prescriptive: Which action are required to be taken to achieve a goal
 Cognitive: Cognitive analytics attempt to draw inferences from existing data and patterns, derive
conclusions based on existing knowledge bases, and then add these findings back into the knowledge
base for future inferences, a self-learning feedback loop

Different Types of Analytics Roles:

 Business analyst:
 Data analyst
 Data engineer
 Data scientist
 Database administrator

Tasks of Analyst:

 Prepare
 Model
 Visualize
 Analyze
 Manage

Parts of Power BI:

 Power Bi Desktop
 Power BI Service
 Power BI Apps

The flow of work in Power BI:

A common flow of work in Power BI begins in Power BI Desktop, where a report is created. That report
is then published to the Power BI service and finally shared, so that users of Power BI Mobile apps can
consume the information.

Building Blocks of Power BI:

 Visualizations:- Visual Representation of Data(Graphs, Maps, Tiles etc.)


 Datasets:- collection of data that is used by power bi for visualization.
 Reports:- report is a collection of visualizations that appear together on one or more pages.
 Dashboards:- Power BI dashboard is a collection of visuals that you can share with others in one page. A dashboard must fit
on a single page, often called a canvas (the canvas is the blank backdrop in Power BI Desktop or the service, where you put
visualizations).
 Tiles:- In Power BI, a tile is a single visualization on a dashboard. It's the rectangular box that holds an individual visual.
______________________________________________________________________

UNIT 2: Prepare Data for Analysis


Get Data from Flat Files:
 csv, text, excel etc.
 FLAT files must be available in below source:
o Local: data is imported to Power Bi but file is not moved to Power BI. Link doesn’t exist to it hence any changes
made in original file will not reflect in power BI until loaded again.
o OneDrive for Business: Used for keeping an Excel file and your dataset, reports, and dashboards in
Power BI synchronized. Power BI connects regularly to your file on OneDrive. If any changes are found, your
dataset, reports, and dashboards are automatically updated in Power BI.
o OneDrive Personal: Same as above only difference is you need to sign in via. Personal account using credentials.
o SharePoint Teams Site: same as OneDrive for business only difference is how you access the file i.e by creating
link/url or connecting to root folder.

Change Source File:

to change the location of a source file for a data source during development, or if a file storage location changes.
Edit in Power Query
1. Data source settings
2. Query settings
3. Advanced Editor

Get Data from Relational Databases:

Get Data >> Select your data source (SQL server) >> add DB details>> select connect mode >> sign in using any method.

Connect Modes:

 IMPORT: brings data to power BI


 DIRECCT QUERY: Directly queries data from source table at time of execution.

Sign IN options:
 Windows :- Windows account(Azure Active Directory)
 Database :- Database username and pwd
 Microsoft:- Microsoft Credentials

Load DATA in Power BI:


After connecting to DB it will show list of tables. Select the required tables and choose one of below options:
 Load – directly load the data as it is.
 Transform – allows you to transform the data.
 Cancel – cancel everything and move out of power query editor.

Import Data by Writing SQL Query:


In the advanced section type your query and click ok.

Create Dynamic Reports with Parameters:


This can be achieved by passing the values through parameters and editing the query to take the parameter value by appending
with & sign.

Storage Modes: Can be changed in model view by selecting data table and edit from Properties.
 Import
The Import mode allows you to create a local Power BI copy of your datasets from your data source. You can use all
Power BI service features with this storage mode, including Q&A and Quick Insights. Data refreshes can be scheduled
or on-demand. Import mode is the default for creating new Power BI reports.
 Direct
The DirectQuery option is useful when you don't want to save local copies of your data because your data won't be
cached. Instead, you can query the specific tables that you'll need by using native Power BI queries, and the required
data will be retrieved from the underlying data source.
 Dual
In Dual mode, you can identify some data to be directly imported and other data that must be queried. Any table
that is brought in to your report is a product of both Import and DirectQuery modes. Using the Dual mode allows
Power BI to choose the most efficient form of data retrieval.

Getting Data from Azure Analysis Service:


Azure Analysis Services is a fully managed platform as a service (PaaS) that provides enterprise-grade data models in
the cloud. You can use advanced mashup and modeling features to combine data from multiple data sources, define
metrics, and secure your data in a single, trusted tabular semantic data model. The data model provides an easier and
faster way for users to perform ad hoc data analysis using tools like Power BI.

Options to get data from Azure Analysis Services:


 Import : import data
 Connect live: is an option for Azure Analysis Services. Azure Analysis Services uses the tabular model and DAX to build
calculations, similar to Power BI. These models are compatible with one another. Using the Connect live option helps you keep
the data and DAX calculations in their original location, without having to import them all into Power BI

Note: Similar to a relational database, you can choose the tables that you want to use. If you want to directly query the Azure Analysis
Services model, you can use DAX or MDX.

Fix Performance Issues:

 Query Folding : Power Query Editor >> Query Settings >> last step in applied steps >> Right click >> Native Query
The query folding within Power Query Editor helps you increase the performance of your Power BI reports. Query
folding is the process by which the transformations and edits that you make in Power Query Editor are
simultaneously tracked as native queries, or simple Select SQL statements, while you're actively making
transformations. The reason for implementing this process is to ensure that these transformations can take place in
the original data source server and don't overwhelm Power BI computing resources.

Native queries aren't possible for the following transformations:


Adding an index column
Merging and appending columns of different tables with two different sources
Changing the data type of a column
 Query diagnostics
To access query diagnostics in Power Query Editor, go to Tools in the Home ribbon. When you're ready to begin
transforming your data or making other edits in Power Query Editor, select Start Diagnostics in the Session
Diagnostics section. When you're finished, make sure that you select Stop Diagnostics. It tells the time taken in each
step
 Process as much data as possible in the original data source.
 Use native SQL queries
 Separate date and time, if bound together.

Resolve Data Import Errors:


 Query Timeout Expired
 Couldn’t find any data formatted as table (mainly for excel . select all and ctrl+T )
 Couldn’t find files : can be fixed by changing file source from power Query Editor
 Data Type error: Sometimes, when you import data into Power BI, the columns appear blank. This situation happens
because of an error in interpreting the data type in Power BI. Can be fixed by using CAST function.

Clean Transform & Load Data:


 Header Promotion
 Replace Values
 Rename Column
 Choose/Remove columns
 Correct Data Type
 Unpivot/Pivot
 Merge/Append tables

Profiling Data: View >> Data Preview Tab(select options)


 Column Quality  Available at top shows you the percentages of data that is valid, in error, and empty
 Column Distribution  shows you the distribution of the data within the column and the counts of distinct and unique values,
both of which can tell you details about the data counts.
 Column Profile  gives you a more in-depth look into the statistics within the columns for the first 1,000 rows of data. This
column provides several different values, including the count of rows.

Note  By default, Power Query examines the first 1000 rows of your data set. To change this, select the profiling status in the status bar
and select Column profiling based on entire data set.
__________________________________________________________________________________________
UNIT 3: Model Data in Power Bi
A good data model offers the following benefits:
 Data exploration is faster.
 Aggregations are simpler to build.
 Reports are more accurate.
 Writing reports takes less time.
 Reports are easier to maintain in the future.

Star Schema  one fact table and multiple standalone dimension table all of them connected to fact table.

Configure Table and Column Properties:


Select Table in Model View and you will get properties pane.

Under the General tab, you can:

 Edit the name and description of the column.


 Add synonyms that can be used to identify the column when you are using the Q&A feature.
 Add a column into a folder to further organize the table structure.
 Hide or show the column.

Under the Formatting tab, you can:

 Change the data type.


 Format the date.

Under the Advanced tab, you can:

 Sort by a specific column.


 Assign a specific category to the data.
 Summarize the data.
 Determine if the column or table contains null values.

Create a common date table


Ways that you can build a common date table are:

 Source data  Having table at source and bring it to Power BI


 DAX  use dax to create columns/tables [Calendar functions]
 Power Query  use power query to create the date table
Create Relationships:
 One to One
 One to Many
 Many to Many

Working with Dimensions:

1. Hierarchies [Category  Subcategory  Names]


Hierarchies allows the drill down of data in single visual just by clicking the data/expanding the data
2. Parent Child  Manger Employee
3. Flatten Parent Child
The process of viewing multiple child levels based on a top-level parent is known as flattening the hierarchy. In this process, you
are creating multiple columns in a table to show the hierarchical path of the parent to the child in the same record. You will use
PATH(), a simple DAX function that returns a text version of the managerial path for each employee, and PATHITEM() to separate
this path into each level of managerial hierarchy.

Result:
Level 1 = PATHITEM(Employee[Path],1)
Level 2 = PATHITEM(Employee[Path],2)
Level 3 = PATHITEM(Employee[Path],3)

Result:

4. Data Granularity  increasing or decreasing the level of details. (Aggregating the data reduces Granularity and vice versa)
5. Cardinality is the measure of unique values in a table.

Difference B/W Dim and Fact:


Characteristic Dimension table Fact table
Model purpose Stores business entities Stores events or observations
Table structure Includes a key column and descriptive columns Includes dimension key columns and numeric
for filtering and grouping measure columns that can be summarized
Data volume Typically, contains fewer rows (relative to fact Can contain numerous rows
tables)
Query purpose To filter and group To summarize

An analytic query has three phases that are implemented in the following order:
1. Filter
2. Group
3. Summarize

Filtering, or slicing, targets the data of relevance. In Power BI reports, filters can be applied to three different scopes: the entire report, a
specific page, or a specific visual. Filtering is also applied in the background when row-level security (RLS) is enforced. Each report visual
can inherit filters or have filters directly applied to it.

Grouping, or dicing, divides query results into groups.

Summarizing produces a single value result. Typically, numeric columns are summarized by using summarization methods (sum, count, and
many others). These methods are simple summarizations. More complex summarizations, like a percent of grand total, can be achieved by
defining measures that are written in DAX.
By using Data Analysis Expressions (DAX), you can add three types of calculations to your data model:
 Calculated tables
 Calculated columns
 Measures  Implicit(sigma sign), Explicit(calculator sign)

Note: Dax can be used to enforce RLS

explicit measures are model calculations that are written in DAX and are commonly referred to as simply measures. Yet, the concept
of implicit measures exists, too. Implicit measures are columns that can be summarized by visuals in simplistic ways, like count, sum,
minimum, maximum, and so on. You can identify implicit measures in the Fields pane because they're shown with the sigma symbol ( ∑).

Dax Variables:

You can declare DAX variables in your formula expressions. When you declare at least one variable, a RETURN clause is used to define the
expression, which then refers to the variables.
We recommend that you use variables because they offer several benefits:
 Improving the readability and maintenance of your formulas.
 Improving performance because variables are evaluated once and only when or if they're needed.
 Allowing (at design time) straightforward testing of a complex formula by returning the variable of interest.

Dax Examples: https://learn.microsoft.com/en-us/training/modules/dax-power-bi-add-calculated-tables/2-calculated-columns

Note:
 Iterator functions iterate over tables and evaluate an expression for each table row.
 The CALCULATETABLE DAX function performs exactly the same functionality as the CALCULATE function, except that it modifies
the filter context that's applied to an expression that returns a table object.

Time Intelligence : https://learn.microsoft.com/en-us/training/modules/dax-power-bi-time-intelligence/3-calculations


https://learn.microsoft.com/en-us/training/modules/dax-power-bi-calculation-groups/introduction

_________________________________________________________________________
UNIT 4: Visualize data in Power Bi
_________________________________________________________________________
UNIT 5: Data Analysis
_________________________________________________________________________
UNIT 6: Manage Workspace & datasets

You might also like