0% found this document useful (0 votes)
106 views

Power BI Unit-I

Uploaded by

shankarmote641
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views

Power BI Unit-I

Uploaded by

shankarmote641
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

B.

Sc (ECS)-II | Data Visualization Unit - 1


 Introduction to Power BI:
What is Business Intelligence, BI Uses and Users, Various BI Tools, Why Power BI, Introduction to
Power BI, Features of Power BI, Power BI Components, Building Blocks of Power BI, Architecture
of Power BI, Power BI Desktop Installation.
 Loading and Transforming dataset:
Data Sources-File Sources, Databases, Loading Data-Web Pages, CSV Files, Text Files, XML Files,
Excel, SQL Server, Refreshing Data.
 Transforming Datasets:
Editing Data After a Data Load, Transforming Data Before Loading, Dataset Shaping-Renaming
Columns, Reordering Columns, Removing Columns, Merging Columns, Duplicating Columns,
Splitting Columns, Removing Records, Removing Duplicate Records, Sorting Data, Reversing the
Row Order, Filtering Data-Selecting Specific Values, Finding Elements in the Filter List, Filtering
Text Ranges, Filtering Numeric Ranges, Filtering Date and Time Ranges
 Creating a Data Model:
Data Modeling in the Power BI Desktop Environment-The Power BI Desktop Data View, Data
Models, Managing Power BI Desktop Data- Manipulating Tables, Manipulating Columns, Power
BI Desktop Data Types, Formatting Power BI Desktop Data, Currency Formats, Preparing Data for
Dashboards, Categorize Data, Apply a Summarization, Define Sort by Columns, Sorting Data in
Power BI Desktop Tables, Adding Hierarchies, Designing a Power BI Desktop Data Model- Data
View and Relationship View, Creating and Deleting Relationships Manually and Automatically.
******************************************************************************
Data Visualization
 Data visualization is a pictorial or graphical representation of data in the form of charts, graphs, etc.
 It extract valuable insights from large and complex data to make better predictions.
 It is easier to convey key information, hidden patterns, plotting charts and graphs.
What is Business Intelligence:
 Business intelligence (BI) refers to collecting, analyzing, and interpreting data to improve the
business ideas, or insights and take profitable business decisions within an organization.
i.e. it converts raw data into meaningful information that drives profitable business actions.
 BI has a direct impact on organization’s strategic and operational business decisions.
 BI supports fact-based decision using historical data rather than assumptions and gut feeling.
 The purpose of BI is to enable stockholder makes better business decisions.
 Business intelligence can be divide into five areas:
o Domain-Sales, Marketing, Manufacturing/production, Logistics, Research and development,
Purchasing, Human resources, Accounting/finance etc.
o Data-Identifying sources of relevant data and acquire structured, unstructured, or semi-
Structured etc.
o Model- Transforming and cleansing data and helps to define data categories
o Analysis- Key performance indicators (KPIs) are help to determine the business health or
performance and allows for better decision-making like identifying trends, forecasting etc.
o Visualization-The results of analysis visualized in the form of charts, graphs, reports, and
dashboards. That helps for better understanding and for better decision.
 BI is set of processes that helps in the collection, integration,
analysis and presentation of business information.
BI Uses:
 Monitoring business performance
 Improve business growth
 Speed up and improve business decisions
 evaluating and improving business processes
 Increase operational efficiency and productivity

1|SHK
B.Sc (ECS)-II | Data Visualization Unit - 1
 Spot business problems
 Identify emerging business and market trends, patterns
 Develop stronger business strategies
 Higher profit and reduce losses

Business Intelligence Users:


1. Analytical users
 Analytical users include data analysts, business analysts, and data scientists who work with data
in-depth to uncover patterns, trends, and correlations.
 They utilize BI tools to perform complex analysis, data mining, generate ad-hoc reports.
 Analytical users have strong technical skills and responsible for transforming raw data into
actionable insights that improves business growth.
2. IT users
 They are responsible for the Business intelligence infrastructure and BI tools.
 They are also try to remove the gap between IT and business operations
3. Executive Users
 Executive users are trust on BI to access summarized and visualized data that provides an
overview of key performance indicators (KPIs) and critical metrics.
 They are high-level decision-makers within an organization like CEO, Heads and Directors etc.
 It also use BI to gain insights for the overall health of the organization, monitor progress towards
strategic goals.
4. Operational Users
 Operational users are monitor and manage operational activities.
 These users include managers, supervisors, and front-line employees.
 Operational users use BI to monitor operational metrics, identify blockages, and take immediate
actions to enhance efficiency and productivity.
5 Self-Service Users
 Self-service users explore data and generate their own reports and visualizations.
 They include business users from various departments such as sales, marketing, finance, and HR.
 Self-service user’s forces user-friendly BI tools that offer in-built interfaces and drag-and-drop
functionalities to explore data, create personalized dashboards, and gain insights.
Various BI Tools
BI tools are used for query and generating reports on data, but they can also combine a large set of
applications for the analysis of data.

2|SHK
B.Sc (ECS)-II | Data Visualization Unit - 1

Data visualization using various tools and charts to create performance scorecards and dashboards,
displaying KPIs and business metrics.
Why Power BI:
 Access and extracts data from multiple sources like Excel, CSV, XML, JSON, cloud, database etc.
 It provides secure and reliable connections to the data sources in the cloud.
 Direct queries run on datasets.
 Helps to users identify valuable trends and make predictions.
 Customized visualization as per user requirement
 Quickly search and extract valuable information.
 Automatically search hidden insights
 Provides a hybrid configuration, quick deployment, and secure environment.
 Less expensive
 It allows real-time dashboard updates.
 It provides pre-built dashboards and reports for SaaS solutions.

Introduction to Power BI:


 Power BI is a powerful data visualization and business intelligence tool that convert different
sources raw data into meaningful and interactive dashboards, reports, graphs, charts etc.
 Power BI reports are helps to the user to analyze the data and make the decision.
 It also allows data analysts to publish reports for your organization.
 Example: A sales dashboard shows the number of units sold in a particular region, earnings of a
location, discounts and schemes offered to the general public, and so on.

 Power BI is a Microsoft’s product initially released on 11th July 2011. It was originally designed
and created by Ron George in 2010.
 Power BI has been officially declared BI tools by 2019
 Power BI is a user-friendly tool offering impressive drag-and-drop features and self-service
capabilities.
3|SHK
B.Sc (ECS)-II | Data Visualization Unit - 1

 Power BI dashboards provide a 360-degree view for business users with their most important
metrics, monitor the health of their businesses, updated in real time, and available on all devices.
 Microsoft offers three types of Power BI platforms:
 Power BI Desktop (A desktop application)
 Power BI Service (SaaS i.e., Software as a Service)
 Power BI Mobile (For iOS and Android devices)

Features of Power BI
 Easy to setup:
You can sign up for free to get started in seconds and start monitoring your data.
 Access data from different sources:
To allows gathering business data from a wider range of data sources like SQL, Azure, Excel,
Text, CSV, PDF, Cloud, database, and on-premises data in the form of unstructured and structured.
 Real Time reports:
Power BI supports real-time data processing, users can view up-to-date data in their dashboards
and reports.
 Customizable Visualizations
Power BI has many built-in visuals to build dashboards and reports as per business needs. Also,
users can download the custom visuals from marketplaces per their requirements.
 Natural Language Q&A Question Box
We can interact with Power BI using natural language queries by typing questions in the Q&A
question box like “What are the total sales for the year 2018?” then, it would show the result with a
beautiful visual or chart.
 Datasets Filtration
Instead of importing the entire dataset, the user can source a subset of dataset as per the user
requirement.
 Data Analysis Expressions (DAX) Function
Data Analysis Expressions (DAX) language to perform advanced calculations, aggregations, and
data manipulations for in-depth analysis.
 Data Relationships
User can define the relationship between those tables at least one matching column.
 Navigation Panel
The navigation pane provides a hierarchical view of the different elements in a report, helping easy
exploration and navigation between pages and sections.
4|SHK
B.Sc (ECS)-II | Data Visualization Unit - 1
 Flexible Tiles
Flexible tiles that can be resized, rearranged, and customized within dashboards, providing us with
the flexibility to design our desired layout.
 Informative Reports
Power BI reports allow us to create informative and visually rich presentations of data insights,
enabling effective communication and data-driven decision-making.
 Help & Feedback Buttons
Power BI provides accessible help resources and feedback channels to assist us (users) in resolving
issues and provide suggestions for platform improvement.
 Office 365 App Launcher
Power BI is integrated with the Office 365 app launcher, allowing users to effortlessly switch
between Power BI and other Microsoft applications.
Power BI Components

1. Power Query
Power Query is a data transformation and ETL (Extract, Transform, Load) tool that allows us to
clean and shape our data before importing it into Power BI. It allows the user to identify, connect,
merge and refine data sources as per the needs of the analysis.
2. Power Pivot
Power Pivot is a data modeling technique that create data models, establishment of relationships
between the data or tables, and define model calculations on simple and complex data using DAX.
3. Power View
Power View is a data visualization tool that allows us to create interactive reports and
visualizations, including charts, tables, and maps, to help us better understand our data. We can
customize the visualizations to meet our specific needs.
4. Power Map
The Power Map creates interactive geographical data visualizations. Power Map is a 3-D data
visualization tool that map your data and plot more than a million rows of data visualization in 3-D
format. Power Map works with Bing maps to visualize based on latitude, longitude, or country,
state, city, and street address information.
5. Data Catalog
Data Catalog helps you to discover the queries and reuse them quickly. To perform the search
function, metadata can be used.
6. Data Management Gateway
Data management gateway joins the data to the cloud. One the data enter to the cloud services it a
refreshers datasets and reflect the visualization more quickly. Data fields can be viewed easily and
expose tables.
7. Power Q&A
It is the fastest way to get an answer from your data using natural language i.e. Ask questions and
5|SHK
B.Sc (ECS)-II | Data Visualization Unit - 1
get immediate answers with natural language query.
8. Power BI Service
The Power Service enables the sharing of workbooks and data views with other users. The data
gets refreshed at regular intervals from the on-premises or/and cloud-based data sources.
9. Power BI Desktop
It is a user friendly development tool for Power View, Power Query, and Power Pivot. You can
import data from a data source, prepare and transform it and use it in visualizations to create
reports in Power BI Desktop.
10. Power BI Website:
It is a web platform to view and share Power BI apps or solutions. You can create dashboards from
reports, share the dashboards with other Power BI users.
Building Blocks of Power BI

 Visualizations
Visualization is a graphical representation of data. These help in restructuring the data for a better
understanding. Visualizations make insights easier to understand because understand a picture
faster than grasping a numbers
Example: Pie Chart, Line Graph, Side by Side Bar Charts, Graphical Presentation of the source
data on top of geographical map, tree map etc.
 Datasets
Dataset is a collection of data that may be imported or linked. Power BI used to create interactive
reports and dashboards. It can be a filtered collection of data which you combined from multiple
different sources to produce a unique collection that can be used in Power BI.
Example: Excel sheets, CSV,XML, JSON, oracle or sql server tables.
 Reports
Report is a collection of visualizations that appear together on one or more pages.
Example: Sales by Country, State, City Report, Logistic Performance Report, Profit report etc.
 Dashboards
It is a collection of various data and reports. Dashboard is single layer presentation of multiple
visualization. i.e we can integrate one or more visualizations in to one page layer.
Example: Sales dashboard can have pie charts, geographical maps and bar charts.
 Tiles
Each and every visual data stored in the report or dashboards are called a Tile. Dashboard is a
collection of Tiles.
Example: Pie Chart in Dashboard or Report.
Architecture of Power BI
Power BI Architecture can be divided into three main phases. The first two phases use ETL
(extract, transform, and load) process to handle the data.

6|SHK
B.Sc (ECS)-II | Data Visualization Unit - 1

1. Data Integration:
 An organization deals with the data that comes from different sources in different file formats.
 First, extract the data from different sources which can be your separate database, servers, etc.
 The data is integrated into a standard format and stored at a common area called staging area.
2. Data Processing:
 The integrated data is not ready for visualization because the data needs processing and
cleansing operations to remove missing values or redundant values. This data is pre-processed.
 After the data is cleaned, business rules are applied to the data and it is transformed into
presentable data. This data will be loaded into the data warehouse.
3. Data Presentation:
 Once the data is loaded and processed, then it can be visualized with the use of various reports,
dashboards, and visualizations using Power BI Desktop.
 These visual reports help business end-users to take business decision based on the insights.
 These visualizations can be published on the web or mobile apps for sharing with other users.
Install Power BI Desktop
 Power BI desktop is the free tool which you can download and install in your local system.
 We can use Power BI desktop to import your data, do the data modelling and then to create
reports and dashboards.
 Microsoft Power BI Desktop is available for 32-bit (x86) and 64-bit (x64) platforms. You can
download according to your system requirements.
 For my 64 bit machine, I have downloaded the 64-bit version of Power BI Desktop.
 Double click on the setup to start the installation. Then click on Next.

7|SHK
B.Sc (ECS)-II | Data Visualization Unit - 1
 Then accept the terms and conditions check box and click on Next.
 Then select the installation folder and Then click on Install button to start the installation.

installation will go:

 Then click on the Finish button to finish the installation.

Advantages of Power BI:


 It is open source and available free of cost.
 Import data from different sources in different file formats.
 It is updated on a regular basis by taking in suggestions from users.
 Data is stored in a centralized location and accessed from anywhere.
 Interactive graphical visualization
 User friendly and easy to use.
 Users also have the option to upload and view data in excel.
 There is no memory constraint when shifting to cloud
Disadvantages of Power BI:
 DAX is not easy to use and limited data sharing
 The user interface of Power BI is crowded making it difficult to view the reports.
 The process of generating visuals and reports requires manual effort and cannot be automated.
8|SHK
B.Sc (ECS)-II | Data Visualization Unit - 1
 Loading and Transforming dataset:
Data Sources-File Sources, Databases, Loading Data-Web Pages, CSV Files, Text Files, XML Files,
Excel, SQL Server, Refreshing Data.
*********************************************************************************
Data Sources in Power BI
 A collection of data that can be imported in Power BI is known as a dataset. Power BI users can
select from a range of data sources through the “Get Data” feature.
 To get the unstructured to structured data from different sources like Excel files, databases such
as SQL Server and Oracle, online locations such as Salesforce and Dynamics, as well as social
media sites like Facebook and Twitter.
 Data may be sourced from one or many different sources that can be combined together.
 You can analyze and produce useful insights from them, you have to connect your Power BI
application to these different sources.

Loading or Import Data form Excel:


To import the data from the source to the Power BI:
1. Go to the “Home” tab in the ribbon section.
2. Click on “Get Data,” options used for take data from different platform or sources
3. Select “Excel.”

 Then, to select the “Excel file” from your computer.


 Next, the “Navigator” page asks you to select the datasheets
 We will go with the “Transform Data” option.
 By clicking on Load, the file gets uploaded without any transformation.

9|SHK
B.Sc (ECS)-II | Data Visualization Unit - 1

The Power BI transforms data button will takes data for cleaning and transforming.
Loading or Import Data form CSV:
Load or import data from CSV file. In the menu bar click on ‘Get data menu → Text/CSV’.

Connect and browse the CSV file and load it.

You can see the data set loaded in the Power Bi


Loading or Import Data from Text Files
 Getting Data from the Text File to Power BI, A normal text file first row has the Column names.
10 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

 Click the Get Data option under the Home tab and select the Text/CSV Option and click the
Connect button.

 Once you click the Connect button, a new window opens to select the Text File from our file
system. We are selecting the Employee.txt file, as shown below.

 Please wait until the connection is established.

 You can now see the preview of the data in the text file.
11 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

 Power BI automatically picks the delimiter and separates the columns. If this is not the case, use
the Delimiter option to change as per your requirement.
 If you are satisfied with the Data and the data types, click the Load button; otherwise, click the
Edit button to make changes.

 Click on the Load button. All the Columns imported from the text file under the Fields section.
 When you click the Edit button, the following window opens. Use this window to change the data
as per your requirements.

 You can get required data from Excel, CSV, text, PDF file, various relational and non-relational
databases, SharePoint, etc.
12 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
Get Web Page Data into Power BI
The Web Data Source enables you to import data from web pages for analysis purposes. It
completely imports data presented in HTML table format from websites.
Go to the Home Tab, click on Get Data and select Web option.

Selected Web option


In From Web, enter the URL of the Web page from which you like to
extract data. Enter URL and Select Ok Button.

Power BI Desktop makes the connection to the data source, and it presents the available data sources
in the Navigator.

Select the Table which you want and to load the data, select the Load button at the bottom of the
Navigator pane.

13 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
Navigator Pane
Then, Loaded data in Field Section.

Importing data from JSON files


 JSON stands for JavaScript Object Notation is one of the most commonly used formats for data
exchange between different platforms and applications.
 To import JSON files, click the “Get Data” and select “JSON” option.

 Locate the JSON file that contains your dataset and import it. The first 5 records in our JSON file:
[{

14 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
"Person_Id": 1,
"Person_Name": "Lyle Puckett",
"Person_Age": 37,
"Person_Gender": "0"
},
{
"Person_Id": 2,
"Person_Name": "Abdul Reed",
"Person_Age": 58,
"Person_Gender": "0"
},
{
"Person_Id": 3,
"Person_Name": "Leonard Raymond",
"Person_Age": 30,
"Person_Gender": "1"
},
{
"Person_Id": 4,
"Person_Name": "Louis Hurley",
"Person_Age": 52,
"Person_Gender": "1"
},
{
"Person_Id": 5,
"Person_Name": "Ulysses Ward",
"Person_Age": 50,
"Person_Gender": "0"
},
 Each person has four properties, i.e., “Person_Id”, “Person_Name”, “Person_Age”, and
“Person_Gender”.
 These properties will be converted into columns. Once the above JSON file is imported, you
should see a list with 100 records.

 If you click on any record, you will see the details of one person. You can see the values for the
“Person_Id”, “Person_Name”, “Person_Age”, and “Person_Gender” columns.

15 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
To return to the previous window, click the “X Navigation” button.

 To convert the List into the table, click the “To Table” button from the top menu.

 Your list will be converted into a table with 1 column. The column contains one record per person,
and each record contains 4 values.

 To create 4 columns, click on the “” button at the top right corner of the column name as shown in
the following figure and click the “OK” button.

 You JSON will be converted into a table. You can see the four column names that correspond to
the properties in JSON files.
16 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

 To create a visualization in the form of a report, you will need to save this table.
 Click the “Close & Apply” button. Once you have done that, you will be taken to the Reports View.

 From the reports view, select the “Clustered column chart”, as shown in the “Visualization” field
below. Add the “Person Gender” column to the Axis and “Person Age” column to the Value field.

 A clustered column chart, such as the one shown below, will be created. The chart shows that the
number of persons with gender id 0 is higher than the ones with gender id 1.
Load Data from PDF file
 The Power BI Desktop contains many preview features. These features are not enabled by default.

17 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 In the File menu, go to Options and settings and click on Options.
 We need to click on the Preview features menu option to use the PDF connector in data source.
 In the preview feature list, enable Get Data from PDF files. We need to restart Power BI to enable
the preview feature. Close Power BI Desktop and re-open it.

 Go to Get Data, you can get a “PDF” option under ‘File’ as a data source.
 Once you click on Connect and provide path of this PDF file from a local directory

 It connects to PDF file and opens a Navigator. It lists out the table from PDF and a list of all
pages. If we select the page, it shows the complete page content in the Navigator preview window.

18 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 We need to get data from this table, therefore, put a check in front of the table, and it shows the
table on the right-hand side page.
 We can choose the required fields from this data set and create a Power BI Visualization.

Importing data from MySQL into Power BI


The process of importing data from MySQL is quite similar to that of importing data from SQL Server.
 Click on the “Get Data” option and select MySQL database

 Once you click the Connect button, you should see the following error.

 To connect Power BI with MySQL Server you need to install a driver that acts as a connector
between Power BI and MySQL Server.
 To download the driver, click on the “Learn more” option in the above screenshot or you can
simply go to this link: https://dev.mysql.com/downloads/file/?id=412152
19 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 Click the “No thanks, just start my download” link highlighted in yellow below, to download the
connector.

 Open the downloaded executable file for the connector. Click the ‘Next’ button.

 You will see the following three download options. You can select any of them.
 For this article, we will use the “Custom” download option and click the Next button.

 Click the Next button.

20 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 Finally, to install the connector, click the Install button.

 Once the installation is completed successfully, you should see the following dialogue box. Click
the Finish button.
 Restart Microsoft Power BI and again select MySQL database from the list of data sources.
 Click the Connect button.
 Enter the name of MySQL Server and database name that you want to import from and click the
OK button.

 MySQL only have the option to import the data image and you cannot execute direct queries on the
dataset.
 Enter the user name and password that you use to access your MySQL Server.

 You will be connected to the MySQL Server and your Server and database names will be visible in
the navigator.
 You will also be able to see all of the tables in your database. Only one is showing below as our
dummy database only has one small table in it.
 To import the dataset from the students table, tick the checkbox next to the students table and click
the Load button.

21 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

 I’ve selected a “Clustered column chart”. The Gender of students will be used for the x-axis while
the values shown will be the students’ average ages.

The output shows that on average, female students are slightly older than male students.
Refreshing Data
 Data refresh is the process of updating data in Power BI with the latest data from the data source.
 When imported data or dataset, data source is updated frequently.
 Data refresh also ensures that the data in the dataset is updated with the latest changes made to the
data source.

The preview data is refreshed and the latest data is displayed.


1. Open your Power BI report or dashboard.
2. Click on the “Home” tab in the menu.
3. Click on the “Refresh Now” button.
4. Power BI will now refresh the data from the connected data sources.

22 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 Transforming Datasets:
Editing Data After a Data Load, Transforming Data Before Loading, Dataset Shaping-Renaming
Columns, Reordering Columns, Removing Columns, Merging Columns, Duplicating Columns,
Splitting Columns, Removing Records, Removing Duplicate Records, Sorting Data, Reversing the
Row Order, Filtering Data-Selecting Specific Values, Finding Elements in the Filter List, Filtering
Text Ranges, Filtering Numeric Ranges, Filtering Date and Time Ranges
*********************************************************************************
Data transformation and cleansing are essential steps in the data editing process in Power BI. To
effectively transform and cleanse your data:
 Analyze data and identify any inconsistencies, errors, or missing values.
 Remove duplicate rows, fix formatting issues, and correct any data errors.
 Apply transformations such as merging datasets, splitting columns, or creating calculated
columns to prepare your data for analysis.
 Handling missing data, either by imputing values or excluding incomplete records.
 Ensure consistent formatting, units, and naming conventions across your datasets.
To effectively transform and cleanse data in Power BI:
 Utilize data cleansing tools and functions provided by Power BI to automate the process.
 Regularly review and update your data cleansing steps to maintain data accuracy.
 Document your data transformation and cleansing process for future reference and
collaboration with team members.
Editing Data after a Data Load
 If you want to make some changes like rename, delete, add column in the already loaded data.
 First, you saved this file with .pbix extension in the disk.
1. Open the Power BI sample file
2. Click the Edit Queries option. The Power BI Desktop Query Editor will open and display
the source data as a table.
3. Right-click the title of the CostPrice column. The column will be selected.

4. Select Rename from the context menu.


5. Type VehicleCost and press Enter. The column title will change to VehicleCost.

6. In the Power BI Desktop Query Editor Home ribbon, click the Close and Apply button.
 The Power BI Desktop Query Editor will close and return you to the Power BI Desktop window.
VehicleCost has replaced CostPrice anywhere that it was used in the dashboard.
23 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
Transforming Data before Loading
 A simple modification to the data before loading the dataset into the Power BI Desktop data model.
 To transform your data before it appears in the Power BI Desktop Window:
1. In the Power BI Desktop Home ribbon, click the Get Data button.
2. Select Excel in the menu and Open the Excel file CarSalesFirstDashboardData.xlsx.
3. In the Navigator window, select the CarSalesData worksheet.

4. Click the Edit or transform data button. The Power BI Desktop Query Editor will open
and display the source data as a table.
5. To rename the CostPrice column as VehicleCost.

6. In the Power BI Desktop Query Editor Home ribbon, click the Close and Apply button.
The Power BI Desktop Query Editor will close and return you to the Power BI Desktop app.
Enter Data:
 Using this option, you can add directly data in table without use of data source.
 You should create a simple table with some columns and rows.

 This will open the Create Table screen:

24 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

 Enter new columns and rows of data. You can also assign table a name. Ex: Orders.

 Click Load to load the data to the Power BI desktop, or Edit to open the Edit Queries window.
Here we will open the Edit queries window.
 To add/remove/change the table and data, under Applied Steps, click the icon next to Source:

The same window will open, allowing you to change the table:

"Transform Data" option.

It retrieves information about the data, allowing you to start refining it.
1. The ribbon now showcases numerous active buttons that facilitate interaction with the data within
the query.
25 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
2. On the left pane, a list of queries is presented, enabling selection, viewing, and shaping options.
3. in the center pane, the data and also use for shaping and manipulation.
4. The Query Settings pane is visible, detailing the properties and applied steps of the query.

Dataset Shaping and Cleaning:


 Power BI's provides in-built tools for dataset shaping and cleaning.
 You can easily remove unnecessary columns, filter rows based on specific criteria, and sort or
group data, changing data types, replacing null or undesired values with appropriate ones, and
remove inconsistencies etc.
• Renaming columns
• Reordering columns
• Removing columns
• Merging columns
• Removing records
• Removing duplicate records
• Filtering the dataset
 Renaming columns
 This feature allows us to assign more readable or appropriate and meaningful column names to
each column but renaming columns is not actually modifying the data of the table.
 To rename a column:
1. Click inside the column that you want to rename.
2. Go to Transform tab.
3. Click the Rename button. The column name will be highlighted.
4. Enter the new name or edit the existing name.
5. Press Enter or click outside the column title

 To rename the columns in a table, right-click on the column that you want to rename will open
the context menu. Select the Rename option. Ex: Renamed column CostPrice to VehicleCost
 The column will now have a new title. The Applied Steps list on the right will now contain
another element, Renamed Columns. This step will be highlighted.
26 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 Reordering columns
 The column order is important because, when you have a large dataset with many columns, the
order of those columns can impact the speed and performance of your report.
 Reorder the columns in a logical and efficient order, which can improve the performance of your
report.
 It easier for users to navigate and understand your data for better insights and decision-making.

 The column sequence will be entirely dependent on the source data.


 Change column order:
1. Click the header of the column you want to move.
2. Drag the column left or right and Drop at the new position.
Option Description
Left Moves the currently selected column to the left of the column on its immediate left.
Right Moves the currently selected column to the right of the column on its immediate right.
To Beginning Moves the currently selected column to the left of all the columns in the query.
To End Moves the currently selected column to the right of all the columns in the query.
 The Move command also works on a set of columns that you have selected by Ctrl-clicking
and move to right, Left, To End, or To Beginning option.
 You can see the “Name of the Student” in the 6th position

 After execution column moved at 4th position.


27 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

 Removing columns
 The dataset contains a variety of columns that are irrelevant or redundant, such as missing values,
extra data points, or unimportant categories.
 To remove all these unnecessary columns and improve the speed or performance of your reports.
Also saves the analysis time.
 Deleting columns can also help you maintain the accuracy and integrity of your data.
 You can ensure that your data is accurate, reliable, most relevant and up-to-date information.
 Delete a column or series of columns:
1. Click inside the column you want to delete, or if you want to delete several columns at once,
Ctrl-click the titles of the columns that you want to delete.
2. Click the Remove Columns button in the Home ribbon.

28 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 Remove Other Columns:
This option is used to remove all the columns from the table except the selected columns.
Ex: selecting the Percentage and Result column and select the Remove Other Columns option
from the context menu.

All the other columns removed from the table.


 Merging Columns:
 Column merging is the process of combining two or more columns into a single column. i.e.
combine data from different sources, similar or related data to your analysis.
 It allows you to simplify your data and make it more manageable.
 It used to create new columns with customized information.
 Instead of dealing with multiple columns, you can ensure that all the relevant information is in
one column or place and avoid errors in your data analysis.
 This can time saving and help you get a better understanding of your data.
Step 1: Select the Columns in Power Query for Merging
 You want to merge the two columns together then just select the columns in Power Query.

Step 2: Merge Columns


 To merge columns in Power Query, click on-
 Add Column > Merge Columns

Step 3: Add Separator to the Merged Column


 After you click on Merge Columns option, a Merge Columns window gets open.
 In this window, you have to add a separator in the Separator option from the dropdown list.
Here, we have selected the Space option as the separator between two texts.
Option Description
Colon Uses the colon (:) as the separator.
Comma Uses the comma (,) as the separator.
Equals Sign Uses the equals sign (=) as the separator.
Semi-Colon Uses the semicolon (;) as the separator.
Space Uses the space ( ) as the separator.
Tab Uses the tab character as the separator.
Custom Enter a custom separator.
29 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

Step 4: Close & Apply


After merging columns successfully, click on Close & Apply button to save the changes.

 Splitting Columns:
 Columns are an essential element of data analysis. They contain information that we need to
manipulate and analyze in order to draw conclusions
 If the information in a column is not well-organized or if we need to extract specific pieces of data
from a single column, which can be especially useful when filtering or sorting data.
 Splitting columns can help restructure information into a more organized format that is easier to
read and analyze.
 It can help to reduce the amount of data duplication and create a more restructured and efficient
data model.
 Example: you can split a column that contains a date and time into separate columns for the date
and time
 If you have multiple values in cells that you want to split out into either rows or columns, you can
use the ‘split column’ feature in Power Query.
 The values in each cell can be split by a delimiter, e.g. comma, semicolon, etc.
 To split each reference into separate rows, in the ‘Home’ section on the top ribbon, we will click
on the ‘Split Column’ button and choose ‘By Delimiter’.

 We will then need to choose which delimiter to split the values by.
 There is more than one delimiter in each cell, we will choose to split for each occurrence of the
delimiter.

30 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
We want is to split the Timestamp column into Date and Time column.
1. Select the column “Right-Click” on the column heading.
2. A drop-down list will appear; select “Split Column.”
3. Then we go for “By Delimiter” to split the column.

Split column by position


We will split the product id column by position.

Once you click on OK, you can see the column is


split into two-column based on the position provided.

 Removing rows/records
 Deleting rows is an essential task for data cleaning and analysis.
 If you want to miss or corrupted data, remove duplicates, remove unwanted or irrelevant data.
 This method allows you to remove unwanted or irrelevant rows one at a time.
 Removing these rows can improve the accuracy of your analysis and make it more user-friendly.
 To allow you to reduce the size of the dataset, Power BI Desktop offers two basic approaches:
1. Keep Rows is used to keep the top N number of rows in a table.
2. Remove Rows is used to remove or delete the N rows in a selected table.
Six different types of row removals:
 Remove Top Rows: It removes Top N number of rows from this table.
1. Go to ‘Home Tab’ and select ‘Remove rows’, click on the ‘Remove Top Rows’ drop-down
menu. I have 19 rows in my table.

31 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
I have entered 6. I have also highlighted the first six rows. After click on ‘Ok,’ the top two rows
have removed now I have only 13 rows in my table.

 Remove Bottom Rows: It removes the N rows from the Bottom of this table.

Enter the number of rows that you want to remove from the bottom. I have entered 10. Click on ‘Ok’, and
your last two lines will be removed.

 Remove Alternate Rows: It deletes the rows based on the pattern. It takes three rows as inputs:
 First row to remove
Enter the row number (index or position) to remove start.
 Number of rows to remove
Enter the number of rows you want to remove each time.
 Number of rows to keep enter the number of rows you want to keep.

 Remove Duplicates: It removes rows containing duplicated values in the currently selected
columns. All duplicate records are deleted and Removed Duplicates are added to the Applied
Steps list.
32 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

 Remove Blank Rows: removes every blank row within a query.

This will automatically remove all of the blank rows in the table:

This results in empty rows being deleted. Removed Blank Rows is then added to the Applied
Steps list.
 Remove Errors: removes rows that contain errors within a specified columns
 Sorting Data
 To sort the data in ascending or descending order.
 To sort data in Power BI using different techniques, such as sorting by columns, values, date, and
time, custom sort orders, sorting pivot tables and adding interactive sorting etc.
 Sort By Column feature is allows you to quickly identify trends and patterns in your data

 Reversing the Row Order


The entire dataset will be reversed and the bottom row will now be the top row. i.e. last row displayed
first.
33 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

 Count Rows: Show the total number of rows in the table.


Filtering Data:
 Remove unnecessary rows or filter data based on specific conditions or criteria.
 Filters are used to select the specific subsets, relevant or segments of data for your analysis that
helps to extract meaningful insights.
 To select a value first and then subsequently refine it to your specific criteria within the formula.
 You can quickly identify patterns, trends, and outliers that might not be immediately visible in
the raw data.
 This can save time and increase efficiency, as users can quickly explore different scenarios and
make knowledgeable decisions based on the data.
 Two basic approaches for filtering data:
 Select one or more specific values from the unique list of elements in the chosen column.
 Define a range of data to include or exclude.
 Selecting Specific Values:
 Selecting one or more values present in a column of data.
1. Click a column’s pop-up menu. Then filter menu appears.
2. Check all elements that you want to sort and uncheck all elements that you want to ignore

 You can deselect all items by clicking the (Select All) check box; reselect all the items by
selecting this box again.
 If you want to keep only a few elements, it may be faster to unselect all of them first and then
only select the ones that you want to keep.
 If you want to exclude any records without a value in the column that you are filtering on then
select Remove Empty from the filter menu.
 Finding Elements in the Filter List:
 Scrolling up and down in a filter list is time consuming. A fast way of finding a subset of
available elements from the list.
1. Click the pop-up menu for a column. Then filter menu appears.
2. Enter a letter or a few letters in the Search box. The list shortens with every letter or number that
you enter. If you enter ‘an’, then the filter popup will look
34 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

 To remove a filter, click the cross that appears at the right of the Search box.
 Filtering Text Ranges:
 If a column contains text, then you can apply Number Filters options to filter the data.
Filter Option Description
Equals Sets the text that must match the cell contents.
Does Not Equal Sets the text that must not match the cell contents.
Begins With Sets the text at the left of the cell contents.
Does Not Begin With Sets the text that must not appear at the left of the cell contents.
Ends With Sets the text at the right of the cell contents.
Does Not End With Sets the text that must not appear at the right of the cell contents.
Contains You enter a text that will be part of the cell contents.
Does Not Contain You enter a text that will not be part of the cell contents.

Result:

 Filtering Numeric Ranges:


 If a column contains numbers, then select Number Filters options can apply to filter the data.
Filter Option Description
Equals Sets the number that must match the cell contents.
Does Not Equal Sets the number that must not match the cell contents.
Greater Than Cell contents must be greater than this number.
Greater Than Or Equal To Cell contents must be greater than or equal to this number.
Lesser Than Cell contents must be less than this number.
Lesser Than Or Equal To Cell contents must be less than or equal to this number.
Between Cell contents must be between the two numbers.

35 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

Result:

 Filtering Date and Time Ranges


 If a column contains dates or times (or both), then Date/Time Filters options can also be applied
to filter the data.

Data Transforming and Cleaning:


 Changing the Table Name
 The table name can be changed from both the options.
 Just double-click the name you want to change and specify the new name.

Changing all the table names.


36 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 Replace Null Value
 Null values can affect the accuracy of data analysis and visualization. It can create misleading
results and skew data trends.
 This feature allows you to replace null values with a specific value or a value based on a
condition.
 Example: you can replace null values with the average of the non-null values in a column
 A table containing numbers null values. To replace the null values with 0, right click on the
column or any row that contains a null value and click ‘Replace Values’ option.
 To specify the value for replacement like enter the value to find as null, and the value to replace
as 0.
 Proceed to set the desired replacement value.
 Then click on OK.

 Result: all instances of null values have now been substituted with the value 0.

 Remove Unnecessary Rows


 We want to remove all the unnecessary rows to make our data more readable.
 We want to remove rows that contain 0 in their data.
1. Select the first column, drop down the list by “Left-Click.”
2. Deselect all the items you don’t want in your datasheet.
3. Click on “OK.”
37 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

The sorted sheet after removing all the unnecessary rows will look like this.

 Change Data Type


 In Power BI, Data type that defines what type of data is stored in that column. Common data types
are Text, Whole number, Decimal number, Date/Time, and Boolean.
 Incorrect data types can also occur when data is imported from external sources.
 This feature is useful to dealing with complex data sets that require unique data types.
 A custom data types are understood by all users to avoid confusion and errors in data analysis.
 Power BI will usually automatically detect the data type of column.
 Choosing the appropriate data type can significantly reduce the amount of storage space required
and improve query performance.
If we want to change the data type:
1. Select the column and “Right-Click” on the column header.
2. A drop-down list will appear; select “Change Type.”
3. Now, again a drop-down list will appear with different data types. Select the data type
according to you.
Here we have selected Fixed Decimal number

 Pivot and Unpivot the Columns


 Data pivoting is a technique used in data analysis to transform data from rows to columns.
 It involves aggregating data and grouping or summarizing it. You can easily find out categories or
variables, highest or lowest values, and how they relate to each other.
38 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 Pivoting data allows to reshape information which is easier to understand and analyze visually.
 It helps to identify patterns, trends, outliers, anomalies, and other important insights that may have
been missed
 Pivoting data is useful for managing large datasets and presenting data in a digestible format.
 Unpivoting data is the process of transform columns into rows. i.e. rotates a column from
horizontal to vertical.
 Unpivoting columns ensure data normalization, data integration, data transformation, and
improves data modeling.
 Unpivoting eliminates repeated data transformation on numerous columns, increasing the
flexibility and efficiency of data models.

 Create Month column as Pivot Column.


 Click on Transform menu and select column which has create pivot column like select
month column as pivot column.
 Select pivot column option and Users column select as a values column and Click on OK.

 See the pivot column


Structure.

39 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 See the report section I have select month then it in pivot Format.

 Unpivot Column: Unpivot means turning Attributes, Values columns into the rows.

 Select all months column to create Unpivot column.


 Select unpivot column option. See the Unpivot column Structure.

 Grouping Records
 Grouping data is the process of organizing similar data into groups.
 This feature in Power BI organize and summarize large amounts of data based on specific criteria
or aggregate functions like average, count, min, max etc.
 It highlight the relationships between different groups of data.
 Grouping helps to categorize data and present it easier to visualize.
 In power query, Go to Home ribbon, click the Group By button.

40 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

 Example: you can group sales data by region and calculate the total sales for each region.
 Advantages of grouping data in Power BI are:
 Enhances data analysis and understanding
 Allows for easy identification of trends, patterns, and outliers
 Simplifies data interpretation
 Helps in faster decision-making
 Improved visualizations
 Conditional Column
 The conditional Column is similar to the IF-Else statement in Excel. It generates columns
according to conditions and specified logic.
 Example:
We want to specify the country abbreviations according to the group they are in.
We want to select the USA for all the groups named ‘North America.’
1. Go to “Add Column.”
2. Select “Conditional Column.”
3. ‘Add Conditional Column’ page will appear, where you will specify the conditions.
4. To give a name to a new column; by default, it sets the name as Custom.
5. Fill in the condition according to your need and click on “OK.”

After the conditional columns are applied:


41 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

42 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 Creating a Data Model:
Data Modeling in the Power BI Desktop Environment-The Power BI Desktop Data View, Data
Models, Managing Power BI Desktop Data- Manipulating Tables, Manipulating Columns, Power
BI Desktop Data Types, Formatting Power BI Desktop Data, Currency Formats, Preparing Data for
Dashboards, Categorize Data, Apply a Summarization, Define Sort by Columns, Sorting Data in
Power BI Desktop Tables, Adding Hierarchies, Designing a Power BI Desktop Data Model- Data
View and Relationship View, Creating and Deleting Relationships Manually and Automatically.
*******************************************************************************
Data modeling:
 Data Modelling is the process of defining relationships between different data tables to create a
unified and meaningful view of the data. i.e. logical or structured representation of data.
 It is a collection of tables and relationships between them that are used to create reports and
visualizations.
 A data model shows how data elements are interact with each other.
 Data modeling is building effective and insightful reports and dashboards.
 It involves shaping and transforming your data.
 The purpose of data modeling is to create a structured, optimized, and meaningful representation of
your data to support effective analysis, reporting, and visualization.
 It involves transforming raw data into a structured format that can be easily analyzed and visualized
Data Modeling in the Power BI Desktop Environment:
 Finding, editing, and loading the source data using queries is preparing your data for the data model.
 The Power BI Desktop Data View
 To start using Power BI Desktop for data modeling:
 Home ribbon is mainly used when creating reports and dashboards
 Modeling ribbon is used to categorize and organize data and tables as well as adding calculated
columns and additional metrics.

 The Power BI Desktop Data View is also different from the Power BI Desktop Query Editor
 In Data View we are looking at all your data. The Query window only always shows a sample of
data.
 Power BI Desktop Query is for finding, filtering and mashing up data and Data View is for
refining and calculating the metrics in your data model.
Button Description
Manage Relationships Join tables as well as delete these joins and modify them.
43 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
New Measure Used to add a new value or calculation to a table.
New Column Adds a new calculated column to a table.
Sort By Column Sorting by column data.
Data Type Define the data type for a column.
Format Specify how numbers are formatted.
Home Table Select the table that will contain a measure.
Data Category Allows you to define that a certain column is of a specific category.
It is mostly used with geographical data for mapping.
Default Summarization Default aggregation that is applied in dashboard visualizations.
Managing Power BI Desktop Data:
 Manipulating Tables
 Preparing data for business intelligence is manipulating the data into standard formats.
 Rename tables: To rename a table that you previously imported.
1. Right-click the table name.
2. Select Rename.
3. Enter the new name or modify the existing name.
4. Press Enter.

 Deleting a tables: To delete a table that you previously imported.


1. Right-click the table name.
2. Select Delete from model.
3. Press Enter.

 Manipulating Columns
 Renaming a Column:
 To rename the column names in an existing table.
 Renaming columns can help with data modeling and creating relationships between tables.
 When working with multiple tables, it is essential to consistent and descriptive column names
to ensure the relationships between tables.
 Renaming columns can also help with data aggregation and visualization, allowing for more
meaningful and informative labels on charts and graphs.
44 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 In the Data pane, right-click on the column/field you want to rename and select "Rename."
 This will go to the field into the Edit mode, where you can change the name.

 When you insert desired data into the visual, click on the dropdown menu on a specific field
and select "Rename for this visual," the name you type in will affect that visual in particular.

 Deleting Columns
 The data may contain a variety of columns that are irrelevant or redundant, such as missing
values, extra data points, or unimportant categories.
 To remove all these unnecessary columns. Deleting columns can also help you maintain the
accuracy and integrity of your data.
1. Right-click the title of the column that you wish to delete.
2. Select Delete Columns from the context menu. Unless the column is empty,

 Deleting unused columns


• Reduce the memory required for the dataset.
• Speed up data refresh operations.
• Reduce the size of the Power BI Desktop file.
Power BI Desktop Data Types
Data types are the fundamental building blocks of any dataset in Power BI. They define the nature of
the information contained within each column. Power BI supports a range of data types, each
designed for a specific category of data.

45 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

DATATYPE DESCRIPTION EXAMPLE


Decimal number Stores numeric values with decimal To calculate total charges of a
places, such as sales amounts or product tax.
prices, measurements, financial
figures, and accurate calculations.

Fixed decimal The decimal separator is fixed in place To list the heights of all the
number for Fixed Decimal Number data types. students in a classroom. 2
There are always four digits to the decimal points of accuracy shall
right of the decimal separator, be enough.
allowing for 19 significant digits.

Whole number Represents whole numbers without Product IDs, employee numbers,
any decimal places. or serial numbers.

Percentage Represent values as percentages, We use percentage in marks


simplifying complex data analysis. obtained in a test, composition of
a product, relative humidity, etc.

Date/Time A Date/Time value is a combination of Events or transactions with both


both a date and a time. Both the values date and time components, like
are stored in decimal numbers order timestamps.
Date Specific date without any associated Used for representing calendar
time information. dates without time information,

46 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
suitable for date-based analysis
like daily sales.

Time Time represents just the time. It does Applied when you need to work
not have any digits to the left of the with times of day independent of
decimal place specific dates, like measuring
response times.

Date/Time/Timezone The data type represents the time and Useful for working with date and
timezone value. This same value can time data that includes timezone
be converted into the date and time information, valuable for
model when formatted. international reporting.
Duration Duration indicates a specific length of Measuring the length of time
time, it transforms into a Decimal intervals, like time spent on tasks
Number type. or project durations.

Text Used for storing alphanumeric product names, customer


characters, such as names, addresses, or employee names etc
descriptions, or labels.

True/False (Boolean) Boolean data types can have one of For representing binary, yes/no,
two values: True or False. or true/false data, often used in
filtering or flagging records.
Binary The Binary data type is used to store Utilized for storing binary data,
binary data, such as images, like images, documents, or other
documents, or any non-textual non-text data in a binary format.
information. It serves as a storage
mechanism for non-text data and is
often used for purposes like document
management and retrieval.

47 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
Formatting Power BI Desktop Data
 It allows you to apply formatting to the data in the tables.
 When you format the data in the Power BI data model, you are defining the format that will be used
in all visualizations in all the dashboards that you create using this metric.

 Currency Formats:
 Power BI Desktop will provides a wide range of currency formats. To choose the currency that you
want:

 Preparing Data for Dashboards


 Preparing data for dashboards involves several steps to ensure that the information presented
accurate, relevant, and actionable.
 To integrating information into a structure that powers your dashboards means specifying data types
and formats.
 Your dashboards need to-
• Categorize data
• Apply a default summarization
• Define Sort By columns
1. Categorize Data
 Power BI is the ability to categorize your data, which allows you to organize and analyze your
data more efficiently.
 Power BI contains geographical data or hyperlinks to web sites or documents.
 You can add maps or hyperlinks and Image links.
 Geographic data can be used to create maps and visualize data based on location.
 Power BI supports several geographic data formats, including latitude and longitude
coordinates, addresses, and postal codes.
 It is easier to identify trends and patterns in large datasets.
1. In the Modeling ribbon, click the pop-up to the right of the Data Category button and
select Country/Region from the menu.
48 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
Data Category Option Description
Uncategorized Applies to data that is not used for hyperlinks or creating maps
Address Specifies an address for mapping
City Specifies for mapping
Continent Specifies a continent for mapping
Country/Region Specifies a country or region for mapping
County Specifies a county for mapping
Latitude Specifies a latitude for mapping
Longitude Specifies a longitude for mapping
Place Specifies a location or place for mapping
Postal Code Specifies a postal (Zip) code for mapping
State or Province Specifies a state or province for mapping
Web URL Indicates an URL for a hyperlink

Showing Images: Image URL


If you have the image URL in a field, and you want to visualize the image instead of the URL of that
image, then you should set the Data Category to Image URL

Links to URLs in the page: Web URL


If you want to have links to URLs in your
Power BI report, use the Web URL option as
Data Category.

49 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
2. Apply a Default Summarization
 When we are creating dashboards, you are frequently grouping numeric data.
 It is a process of summarizing large volumes of data into meaningful and manageable insights.
 Power BI provides several summarization techniques like sum, average, count, and minimum
and maximum values.
 In the Modeling ribbon, click the pop-up to the right of the Default Summarization button and
select option from the menu.

Option Description
Do Not Summarize Column data is not summarized
Sum Column data is summed
Average Return average value of column
Minimum Return minimum value of column
Maximum Return maximum value of column
Count Return number of elements in the column
Count (Distinct) Return number of individual (distinct) elements in the column
3. Define Sort by Columns:
 Custom sorting in Power BI refers to the ability to arrange data in a specific order that is not
based on traditional sorting methods, such as alphabetical or numerical order.
 To sort data in a dashboard visualization based not on the contents of the selected column, but
by the contents of another column.
 The field itself can be sorted based on another column is called as Sort By Column.
 By sorting columns in the desired order, users can enhance data visualization and understanding,
reports and dashboards.
 This feature allows users to define their own sorting logic based on their unique requirements.
 Example: A table contains the month for a sale. If you want to sort a column month name to be
sorted by values of another column month number
 In the Modeling ribbon, click the Sort By Column button and select MonthNum from the list of
available columns.

50 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 The dataset has Month and Sales. The Month values in text, not numbers.
 A line chart, the Month column is on the X-axis and Sales on the Y-axis.
 By default, the visualization sorts by the monthly sales value, which makes a confusion of the
month order along the X-axis. The visualization is misleading.
 You might try to fix the month sort by resorting on the visualization as follows:
1. Click the More Options icon, which is the three dots at the top or bottom right of your visualization.
2. Choose Sort Axis.

Choose the Month field for sorting.

3. Choose Month from the submenu to resort the X-axis — the months.
 It showing ups and downs.
 Power BI sorted the months alphabetically and in descending order. the results are misleading.
 We need to sort months chronologically in order to get meaningful results.
Sorting Data in Power BI Desktop Tables
 To sort the data in ascending or descending order.
 To sort data in Power BI using different techniques, such as sorting by columns, values, date, and
time, custom sort orders, sorting pivot tables and adding interactive sorting etc.
 Sort By Column feature is allows you to quickly identify trends and patterns in your data
1. Right-click inside the column you want to sort data by.
2. Click the Sort Ascending option in the context menu to sort this column in ascending.

Adding Hierarchies
 A hierarchy is creating logical groups of data that are organized by category and level.
 It consists of a set of ordered levels.
 It allows to navigate and analyze large volumes of data.
 By using hierarchies, end-users can easily drill down into the data and have a quick overview and a
better understanding.
 Users can quickly drill down into specific areas of interest and identify key trends and insights.
 Hierarchy provides a structure for effective data analysis and visualization of complex data sets.
51 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 It also helps to improve your reports and dashboards.
 To create a hierarchy:
1. Switch to Report View.
2. Right-click on the field that will become the top-level element in the new hierarchy.
3. Select New Hierarchy. A new hierarchy named Make Hierarchy will appear in the table.
4. Drag the Model field onto the new hierarchy.
Drag the hierarchy on to the report canvas to create a table that is based on the multiple elements that
make up the hierarchy. They are particularly useful as the basis for matrices and drill-down charts.

1. To create a hierarchy
Make as level-1
Model level-2
Vehicle_Type as level-3
2. Right-click on the field you want to set as level 1 of the hierarchy in the fields list.
3. Select Create Hierarchy.
4. A new hierarchy created named your field name “Car Hierarchy”.

A Make field inside the hierarchy is reference to the original category column. Its not a new column
or duplicate.
5. To add another level to the hierarchy, just drag Model to the Category Hierarchy header or right-
click on the Model and use Add to hierarchy.

This adds that field as the second level of the hierarchy; a third level of the hierarchy;
If you want to rename the hierarchy, you can do it by renaming the Category Hierarchy itself. If you
want to change the order of levels, you can drag and drop them over each other.
52 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

Hierarchy can be used for data exploration. With a structure like the above hierarchies, you can easily
drill down or up from a level to another level.
Designing a Power BI Desktop Data Model
 After importing data, if dataset is ready for initial use for self-service BI
 A data repository is to create and manage relationships between tables.
 To define a relationship, two tables having a common field (column) or feature.
 To developing a high-performance data model for self-service business intelligence (BI).
 Table relationships are links between tables that allow columns in one table to be used in another
table.
 Example: one table with customer names and another with their orders, relationships allow you to
see which customers made which orders.
 Data models that contain data from multiple tables that must be connected through relationships.

 Data View
 Data view helps you review, explore, and understand data in your model.
 Data view shows data after it's loaded into the model, the Data view icon isn't visible if all data sources are
based on DirectQuery.
1. Data view icon: Select this icon to enter Data view.
2. Data Grid: This area shows the selected table and all columns and rows in it. Columns hidden from
the Report view are greyed out. You can right-click on a column for options.
3. Formula bar: Enter DAX formulas for Measures and Calculated columns.
4. Search: Search for a table or column in your model.
5. Fields list: Select a table or column to view in the data grid.

53 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

 Relationship View:
 Power BI will automatically try to detect relationships between tables based on common column if any
exists. It discovers as keys.

 Example: The productKey column in the Product Details table is connected to the productKey column in
the SalesData Table. Similarly, the Sales Data table and Calendar table are being joined together by the
date and the date columns. Columns that join tables together through foreign keys and primary keys.
 Relationship View offers the ability to create multiple data model schemas.

Creating and Deleting Relationships Manually and Automatically:


 Relationships is establish connections between different tables of data.
 These relationships are essential for creating meaningful visualizations, reports, and dashboards by
allowing you to combine and analyze data from multiple tables logically.
 There are four types of relationships: One-to-one, One-to-many, Many-to-one, and Many-to-many.
 You can create relationships manually or use Autodetect during data import.
 Managing relationships is essential for data model maintenance and analysis.
 Create a relationship Automatically (use autodetect)
 The Power BI autodetect feature tries to find and create relationships. The column
names ‘Product’ in both tables are the same.

54 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1
 The autodetect feature will automatically create a relationship between both tables based on
the ‘Product’ column.

 Now, right-click on the yellow-highlighted relationship line and select ‘Delete.’ After, click
on ‘Manage relationships.’ No relationships between both tables. click on the ‘Autodetect’ button.

 Manage Relationship Autodetect


The relationship between both tables.

 Edit a relationship
Way-1: Go to Modeling tab in Power BI header menu > select Manage Relationships >
In the Manage relationships dialog box, select the relationship, and then select Edit.
Way-2: Inside Model view double click on Relationship line >Edit relationships dialog box appears.
Way-3: Inside Model view > Click on Home tab, select Manage Relationships > In the Manage
relationships dialog box, select the relationship, then select Edit.

 Create a Relationship Manually:


 Way-1: Inside the Model view > Click on the Home tab, select Manage Relationships > In
the Manage relationships dialog box, select New.
55 | S H K
B.Sc (ECS)-II | Data Visualization Unit - 1

 After the ‘Create Relationship’, select both tables in each dropdown and choose
the ‘Product’ column from both tables, then click on the ‘OK’ button.

 Way-2: Go to Modeling tab in Power BI header menu > select Manage Relationships >
In the Manage relationships dialog box, then select New.
 Delete Relationship:
-Under Model view, right click on Relationship line and select Delete.
-Delete through Mange Relationships dialog box.

56 | S H K

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy