0% found this document useful (0 votes)
1K views208 pages

Course 2-AI NEP Notes

Uploaded by

404ucantfindme
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)
1K views208 pages

Course 2-AI NEP Notes

Uploaded by

404ucantfindme
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/ 208

Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Course – 2 - Data Analyst Associate (DA-100)


DA-100 pathway consists of 5 courses and 2 reading material:
Unit 1. Get started with Microsoft data analytics
Unit 2. Prepare data for analysis
Unit 3. Model data in Power BI
Unit 4. Visualize data in Power BI
Unit 5. Data analysis in Power BI
Unit 6. Manage workspaces and datasets in Power BI
Unit 7. Key Influencers Visualizations Tutorial - Power BI
Unit 8. Smart Narratives Tutorial - Power BI | Microsoft Docs

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 1


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Unit 1:
Get started with Microsoft data analytics

1.1 Introduction
As a data analyst, you are on a journey. Think about all the data that is being generated each
day and that is available in an organization, from transactional data in a traditional database,
telemetry data from services that you use, to signals that you get from different areas like social
media.

For example, today's retail businesses collect and store massive amounts of data that track the
items you browsed and purchased, the pages you've visited on their site, the aisles you purchase
products from, your spending habits, and much more.

With data and information as the most strategic asset of a business, the underlying challenge
that organizations have today is understanding and using their data to positively affect change
within the business. Businesses continue to struggle to use their data in a meaningful and
productive way, which impacts their ability to act.

A retail business should be able to use their vast amounts of data and information in such a way
that impacts the business, including:

 Tracking inventory
 Identifying purchase habits
 Detecting user trends and patterns
 Recommending purchases
 Determining price optimizations
 Identifying and stopping fraud

Additionally, you might be looking for daily/monthly sale patterns. Common data segments
that you might want to examine include day-over-day, week-over-week, and month-over-
month so that you can compare how sales have been to where they were in the same week last
year, for example.

The key to unlocking this data is being able to tell a story with it. In today's highly competitive
and fast-paced business world, crafting reports that tell that story is what helps business leaders
take action on the data. Business decision makers depend on an accurate story to drive better
business decisions. The faster a business can make precise decisions, the more competitive they

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 2


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

will be and the better advantage they will have. Without the story, it is difficult to understand
what the data is trying to tell you.

However, having data alone is not enough. You need to be able to act on the data to affect
change within the business. That action could involve reallocating resources within the
business to accommodate a need, or it could be identifying a failing campaign and knowing
when to change course. These situations are where telling a story with your data is important.

The underlying challenge that businesses face today is understanding and using their data in
such a way that impacts their business and ultimately their bottom line. You need to be able to
look at the data and facilitate trusted business decisions. Then, you need the ability to look at
metrics and clearly understand the meaning behind those metrics.

This requirement might seem daunting, but it's a task that you can accomplish. Your first step
is to partner with data experts within your organization, such as data engineers and data
scientists, to help get the data that you need to tell that story. Ask these experts to participate
in that data journey with you.

Your journey of telling a story with data also ties into building that data culture within your
organization. While telling the story is important, where that story is told is also crucial,
ensuring that the story is told to the right people. Also, make sure that people can discover the
story, that they know where to find it, and that it is part of the regular interactions.

Data analysis exists to help overcome these challenges and pain points, ultimately assisting
businesses in finding insights and uncovering hidden value in troves of data through
storytelling. As you read on, you will learn how to use and apply analytical skills to go beyond
a single report and help impact and influence your organization by telling stories with data and
driving that data culture.

1.2 Overview of data analysis

Before data can be used to tell a story, it must be run through a process that makes it usable in
the story. Data analysis is the process of identifying, cleaning, transforming, and modeling data
to discover meaningful and useful information. The data is then crafted into a story through
reports for analysis to support the critical decision-making process.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 3


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

As the world becomes more data-driven, storytelling through data analysis is becoming a vital
component and aspect of large and small businesses. It is the reason that organizations continue
to hire data analysts.

Data-driven businesses make decisions based on the story that their data tells, and in today's
data-driven world, data is not being used to its full potential, a challenge that most businesses
face. Data analysis is, and should be, a critical aspect of all organizations to help determine the
impact to their business, including evaluating customer sentiment, performing market and
product research, and identifying trends or other data insights.

While the process of data analysis focuses on the tasks of cleaning, modeling, and visualizing
data, the concept of data analysis and its importance to business should not be understated. To
analyze data, core components of analytics are divided into the following categories:

 Descriptive
 Diagnostic
 Predictive
 Prescriptive
 Cognitive

Descriptive analytics

Descriptive analytics help answer questions about what has happened based on historical data.
Descriptive analytics techniques summarize large datasets to describe outcomes to
stakeholders.

By developing key performance indicators (KPIs), these strategies can help track the success
or failure of key objectives. Metrics such as return on investment (ROI) are used in many
industries, and specialized metrics are developed to track performance in specific industries.

An example of descriptive analytics is generating reports to provide a view of an organization's


sales and financial data.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 4


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Diagnostic analytics

Diagnostic analytics help answer questions about why events happened. Diagnostic analytics
techniques supplement basic descriptive analytics, and they use the findings from descriptive
analytics to discover the cause of these events. Then, performance indicators are further
investigated to discover why these events improved or became worse. Generally, this process
occurs in three steps:

1. Identify anomalies in the data. These anomalies might be unexpected changes in a


metric or a particular market.
2. Collect data that's related to these anomalies.
3. Use statistical techniques to discover relationships and trends that explain these
anomalies.

Predictive analytics

Predictive analytics help answer questions about what will happen in the future. Predictive
analytics techniques use historical data to identify trends and determine if they're likely to recur.
Predictive analytical tools provide valuable insight into what might happen in the future.
Techniques include a variety of statistical and machine learning techniques such as neural
networks, decision trees, and regression.

Prescriptive analytics

Prescriptive analytics help answer questions about which actions should be taken to achieve a
goal or target. By using insights from prescriptive analytics, organizations can make data-
driven decisions. This technique allows businesses to make informed decisions in the face of
uncertainty. Prescriptive analytics techniques rely on machine learning as one of the strategies
to find patterns in large datasets. By analyzing past decisions and events, organizations can
estimate the likelihood of different outcomes.

Cognitive analytics

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. Cognitive analytics help
you learn what might happen if circumstances change and determine how you might handle
these situations.

Inferences aren't structured queries based on a rules database; rather, they're unstructured
hypotheses that are gathered from several sources and expressed with varying degrees of
confidence. Effective cognitive analytics depend on machine learning algorithms, and will use
several natural language processing concepts to make sense of previously untapped data
sources, such as call center conversation logs and product reviews.

Example

By enabling reporting and data visualizations, a retail business uses descriptive analytics to
look at patterns of purchases from previous years to determine what products might be popular

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 5


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

next year. The company might also look at supporting data to understand why a particular
product was popular and if that trend is continuing, which will help them determine whether to
continue stocking that product.

A business might determine that a certain product was popular over a specific timeframe. Then,
they can use this analysis to determine whether certain marketing efforts or online social
activities contributed to the sales increase.

An underlying facet of data analysis is that a business needs to trust its data. As a practice, the
data analysis process will capture data from trusted sources and shape it into something that is
consumable, meaningful, and easily understood to help with the decision-making process. Data
analysis enables businesses to fully understand their data through data-driven processes and
decisions, allowing them to be confident in their decisions.

As the amount of data grows, so does the need for data analysts. A data analyst knows how to
organize information and distill it into something relevant and comprehensible. A data analyst
knows how to gather the right data and what to do with it, in other words, making sense of the
data in your data overload.

1.3 Roles in data

Telling a story with the data is a journey that usually doesn't start with you. The data must come
from somewhere. Getting that data into a place that is usable by you takes effort that is likely
out of your scope, especially in consideration of the enterprise.

Today's applications and projects can be large and intricate, often involving the use of skills
and knowledge from numerous individuals. Each person brings a unique talent and expertise,
sharing in the effort of working together and coordinating tasks and responsibilities to see a
project through from concept to production.

In the recent past, roles such as business analysts and business intelligence developers were the
standard for data processing and understanding. However, excessive expansion of the size and
different types of data has caused these roles to evolve into more specialized sets of skills that
modernize and streamline the processes of data engineering and analysis.

The following sections highlight these different roles in data and the specific responsibility in
the overall spectrum of data discovery and understanding:

 Business analyst

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 6


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

 Data analyst
 Data engineer
 Data scientist
 Database administrator

Business analyst

While some similarities exist between a data analyst and business analyst, the key differentiator
between the two roles is what they do with data. A business analyst is closer to the business
and is a specialist in interpreting the data that comes from the visualization. Often, the roles of
data analyst and business analyst could be the responsibility of a single person.

Data analyst

A data analyst enables businesses to maximize the value of their data assets through
visualization and reporting tools such as Microsoft Power BI. Data analysts are responsible for
profiling, cleaning, and transforming data. Their responsibilities also include designing and
building scalable and effective data models, and enabling and implementing the advanced
analytics capabilities into reports for analysis. A data analyst works with the pertinent
stakeholders to identify appropriate and necessary data and reporting requirements, and then
they are tasked with turning raw data into relevant and meaningful insights.

A data analyst is also responsible for the management of Power BI assets, including reports,
dashboards, workspaces, and the underlying datasets that are used in the reports. They are
tasked with implementing and configuring proper security procedures, in conjunction with
stakeholder requirements, to ensure the safekeeping of all Power BI assets and their data.

Data analysts work with data engineers to determine and locate appropriate data sources that
meet stakeholder requirements. Additionally, data analysts work with the data engineer and
database administrator to ensure that the analyst has proper access to the needed data sources.
The data analyst also works with the data engineer to identify new processes or improve
existing processes for collecting data for analysis.

Data engineer

Data engineers provision and set up data platform technologies that are on-premises and in the
cloud. They manage and secure the flow of structured and unstructured data from multiple
sources. The data platforms that they use can include relational databases, nonrelational
databases, data streams, and file stores. Data engineers also ensure that data services securely
and seamlessly integrate across data platforms.

Primary responsibilities of data engineers include the use of on-premises and cloud data
services and tools to ingest, egress, and transform data from multiple sources. Data engineers
collaborate with business stakeholders to identify and meet data requirements. They design and
implement solutions.

While some alignment might exist in the tasks and responsibilities of a data engineer and a
database administrator, a data engineer's scope of work goes well beyond looking after a

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 7


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

database and the server where it's hosted and likely doesn't include the overall operational data
management.

A data engineer adds tremendous value to business intelligence and data science projects.
When the data engineer brings data together, often described as data wrangling, projects move
faster because data scientists can focus on their own areas of work.

As a data analyst, you would work closely with a data engineer in making sure that you can
access the variety of structured and unstructured data sources because they will support you in
optimizing data models, which are typically served from a modern data warehouse or data lake.

Both database administrators and business intelligence professionals can transition to a data
engineer role; they need to learn the tools and technology that are used to process large amounts
of data.

Data scientist

Data scientists perform advanced analytics to extract value from data. Their work can vary
from descriptive analytics to predictive analytics. Descriptive analytics evaluate data through
a process known as exploratory data analysis (EDA). Predictive analytics are used in machine
learning to apply modeling techniques that can detect anomalies or patterns. These analytics
are important parts of forecast models.

Descriptive and predictive analytics are only partial aspects of data scientists' work. Some data
scientists might work in the realm of deep learning, performing iterative experiments to solve
a complex data problem by using customized algorithms.

Anecdotal evidence suggests that most of the work in a data science project is spent on data
wrangling and feature engineering. Data scientists can speed up the experimentation process
when data engineers use their skills to successfully wrangle data.

On the surface, it might seem that a data scientist and data analyst are far apart in the work that
they do, but this conjecture is untrue. A data scientist looks at data to determine the questions
that need answers and will often devise a hypothesis or an experiment and then turn to the data
analyst to assist with the data visualization and reporting.

Database administrator

A database administrator implements and manages the operational aspects of cloud-native and
hybrid data platform solutions that are built on Microsoft Azure data services and Microsoft
SQL Server. A database administrator is responsible for the overall availability and consistent
performance and optimizations of the database solutions. They work with stakeholders to
identify and implement the policies, tools, and processes for data backup and recovery plans.

The role of a database administrator is different from the role of a data engineer. A database
administrator monitors and manages the overall health of a database and the hardware that it
resides on, whereas a data engineer is involved in the process of data wrangling, in other words,
ingesting, transforming, validating, and cleaning data to meet business needs and requirements.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 8


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The database administrator is also responsible for managing the overall security of the data,
granting and restricting user access and privileges to the data as determined by business needs
and requirements.

1.4 Tasks of a data analyst


A data analyst is one of several critical roles in an organization, who help uncover and make
sense of information to keep the company balanced and operating efficiently. Therefore, it's
vital that a data analyst clearly understands their responsibilities and the tasks that are
performed on a near-daily basis. Data analysts are essential in helping organizations gain
valuable insights into the expanse of data that they have, and they work closely with others in
the organization to help reveal valuable information.

The following figure shows the five key areas that you'll engage in during the data analysis
process.

Prepare

As a data analyst, you'll likely divide most of your time between the prepare and model tasks.
Deficient or incorrect data can have a major impact that results in invalid reports, a loss of trust,
and a negative effect on business decisions, which can lead to loss in revenue, a negative
business impact, and more.

Before a report can be created, data must be prepared. Data preparation is the process of
profiling, cleaning, and transforming your data to get it ready to model and visualize.

Data preparation is the process of taking raw data and turning it into information that is trusted
and understandable. It involves, among other things, ensuring the integrity of the data,
correcting wrong or inaccurate data, identifying missing data, converting data from one
structure to another or from one type to another, or even a task as simple as making data more
readable.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 9


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Data preparation also involves understanding how you're going to get and connect to the data
and the performance implications of the decisions. When connecting to data, you need to make
decisions to ensure that models and reports meet, and perform to, acknowledged requirements
and expectations.

Privacy and security assurances are also important. These assurances can include anonymizing
data to avoid oversharing or preventing people from seeing personally identifiable information
when it isn't needed. Alternatively, helping to ensure privacy and security can involve removing
that data completely if it doesn't fit in with the story that you're trying to shape.

Data preparation can often be a lengthy process. Data analysts follow a series of steps and
methods to prepare data for placement into a proper context and state that eliminate poor data
quality and allow it to be turned into valuable insights.

Model

When the data is in a proper state, it's ready to be modeled. Data modeling is the process of
determining how your tables are related to each other. This process is done by defining and
creating relationships between the tables. From that point, you can enhance the model by
defining metrics and adding custom calculations to enrich your data.

Creating an effective and proper data model is a critical step in helping organizations
understand and gain valuable insights into the data. An effective data model makes reports
more accurate, allows the data to be explored faster and more efficient, decreases time for the
report writing process, and simplifies future report maintenance.

The model is another critical component that has a direct effect on the performance of your
report and overall data analysis. A poorly designed model can have a drastically negative
impact on the general accuracy and performance of your report. Conversely, a well-designed
model with well-prepared data will ensure a properly efficient and trusted report. This notion
is more prevalent when you are working with data at scale.

From a Power BI perspective, if your report is performing slowly, or your refreshes are taking
a long time, you will likely need to revisit the data preparation and modeling tasks to optimize
your report.

The process of preparing data and modeling data is an iterative process. Data preparation is the
first task in data analysis. Understanding and preparing your data before you model it will make
the modeling step much easier.

Visualize

The visualization task is where you get to bring your data to life. The ultimate goal of the
visualize task is to solve business problems. A well-designed report should tell a compelling
story about that data, which will enable business decision makers to quickly gain needed
insights. By using appropriate visualizations and interactions, you can provide an effective
report that guides the reader through the content quickly and efficiently, therefore allowing the
reader to follow a narrative into the data.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 10


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The reports that are created during the visualization task help businesses and decision makers
understand what that data means so that accurate and vital decisions can be made. Reports drive
the overall actions, decisions, and behaviors of an organization that is trusting and relying on
the information that is discovered in the data.

The business might communicate that they need all data points on a given report to help them
make decisions. As a data analyst, you should take the time to fully understand the problem
that the business is trying to solve. Determine whether all their data points are necessary
because too much data can make detecting key points difficult. Having a small and concise
data story can help find insights quickly.

With the built-in AI capabilities in Power BI, data analysts can build powerful reports, without
writing any code, that enable users to get insights and answers and find actionable objectives.
The AI capabilities in Power BI, such as the built-in AI visuals, enable the discovering of data
by asking questions, using the Quick Insights feature, or creating machine learning models
directly within Power BI.

An important aspect of visualizing data is designing and creating reports for accessibility. As
you build reports, it is important to think about people who will be accessing and reading the
reports. Reports should be designed with accessibility in mind from the outset so that no special
modifications are needed in the future.

Many components of your report will help with storytelling. From a color scheme that is
complementary and accessible, to fonts and sizing, to picking the right visuals for what is being
displayed, they all come together to tell that story.

Analyze

The analyze task is the important step of understanding and interpreting the information that is
displayed on the report. In your role as a data analyst, you should understand the analytical
capabilities of Power BI and use those capabilities to find insights, identify patterns and trends,
predict outcomes, and then communicate those insights in a way that everyone can understand.

Advanced analytics enables businesses and organizations to ultimately drive better decisions
throughout the business and create actionable insights and meaningful results. With advanced
analytics, organizations can drill into the data to predict future patterns and trends, identify
activities and behaviors, and enable businesses to ask the appropriate questions about their data.

Previously, analyzing data was a difficult and intricate process that was typically performed by
data engineers or data scientists. Today, Power BI makes data analysis accessible, which
simplifies the data analysis process. Users can quickly gain insights into their data by using
visuals and metrics directly from their desktop and then publish those insights to dashboards
so that others can find needed information.

This feature is another area where AI integrations within Power BI can take your analysis to
the next level. Integrations with Azure machine learning, cognitive services, and built-in AI
visuals will help to enrich your data and analysis.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 11


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Manage

Power BI consists of many components, including reports, dashboards, workspaces, datasets,


and more. As a data analyst, you are responsible for the management of these Power BI assets,
overseeing the sharing and distribution of items, such as reports and dashboards, and ensuring
the security of Power BI assets.

Apps can be a valuable distribution method for your content and allow easier management for
large audiences. This feature also allows you to have custom navigation experiences and link
to other assets within your organization to complement your reports.

The management of your content helps to foster collaboration between teams and individuals.
Sharing and discovery of your content is important for the right people to get the answers that
they need. It is also important to help ensure that items are secure. You want to make sure that
the right people have access and that you are not leaking data past the correct stakeholders.

Proper management can also help reduce data silos within your organization. Data duplication
can make managing and introducing data latency difficult when resources are overused. Power
BI helps reduce data silos with the use of shared datasets, and it allows you to reuse data that
you have prepared and modeled. For key business data, endorsing a dataset as certified can
help to ensure trust in that data.

The management of Power BI assets helps reduce the duplication of efforts and helps ensure
security of the data.

Check your knowledge


Answer the following questions to see what you've learned.
1. Which data role enables advanced analytics capabilities specifically through reports and visualizations?

Data scientist

Data engineer

Data analyst

A data analyst uses appropriate visuals to help business decision makers gain deep and
meaningful insights from data.

2. Which data analyst task has a critical performance impact on reporting and data analysis?

Model

An optimized and tuned data model performs better and provides a better data analysis
experience.

Analyze

Visualize

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 12


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

3.

Which one of the following options is the most important key benefit of data analysis?

Decisive analytics

Informed business decisions

A key benefit of data analysis is the ability to gain valuable insights from a business's data
assets to make timely and optimal business decisions.

Complex reports

Summary
In this module, you learned that the role of data analyst is vital to the success of an organization.
Additionally, the tasks that data analysts perform help ensure that the business decisions are
based on trusted data. You also learned about the different roles in data and how the people in
these roles work closely with a data analyst to deliver valuable insights into a business's data
assets.

Unit 2:
Prepare data for analysis

2.1 Introduction
Like most of us, you work for a company where you are required to build Microsoft Power BI
reports. The data resides in several different databases and files. These data repositories are
different from each other, some are in Microsoft SQL Server, some are in Microsoft Excel, but
all the data is related.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 13


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

https://www.microsoft.com/en-us/videoplayer/embed/RWFSPW?postJsllMsg=true

Note:The module sections prior to the lab are purely informational. You will be given the
opportunity to work with real data during the lab.

In this module’s scenario you work for Tailwind Traders. You’ve been tasked by senior
leadership to create a suite of reports that are dependent on data in several different locations.
The database that tracks sales transactions is in SQL Server, a relational database that contains
what items each customer bought and when. It also tracks which employee made the sale, along
with the employee name and employee ID. However, that database doesn’t contain the
employee’s hire date, their title, or who their manager is. For that information, you need to
access files that Human Resources keeps in Excel. You've been consistently requesting that
they use an SQL database, but they haven't yet had the chance to implement it.

When an item ships, the shipment is recorded in the warehousing application, which is new to
the company. The developers chose to store data in Cosmos DB, as a set of JSON documents.

Tailwind Traders has an application that helps with financial projections, so that they can
predict what their sales will be in future months and years, based on past trends. Those
projections are stored in Microsoft Azure Analysis Services. Here’s a view of the many data
sources you are asked to combine data from.

Before you can create reports, you must first extract data from the various data sources.
Interacting with SQL Server is different from Excel, so you should learn the nuances of both
systems. After you’ve learned the particulars of each system, you can use Power Query (the
query engine used by Power BI and Excel) to help you clean the data, such as renaming
columns, replacing values, removing errors, and combining query results. After the data has
been cleaned and organized, you are ready to build reports in Power BI. Finally, you will
publish your combined dataset and reports to Power BI service (PBIS). From there, other
people can use your dataset and build their own reports or they can use the reports that
you’ve already built. Additionally, if someone else built a dataset that you'd like to use, you
can build reports from that, too!

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 14


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

This module will focus on the first step, of getting the data from the different data sources
and importing it into Power BI by using Power Query.

By the end of this module, you’ll be able to:

 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

2.2 Get data from files


Organizations often export and store data in files. One possible file format is a flat file. A flat
file is a type of file that has only one data table and every row of data is in the same structure.
The file does not contain hierarchies. Likely, you're familiar with the most common types of
flat files, which are comma-separated values (.csv) files, delimited text (.txt) files, and fixed
width files. Another type of file would be the output files from different applications, like
Microsoft Excel workbooks (.xlsx).

Power BI Desktop allows you to get data from many types of files. You can find a list of the
available options when you use the Get data feature in Power BI Desktop. The following
sections explain how you can import data from an Excel file that is stored on a local computer.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 15


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Scenario

The Human Resources (HR) team at Tailwind Traders has prepared a flat file that contains
some of your organization's employee data, such as employee name, hire date, position, and
manager. They've requested that you build Power BI reports by using this data, and data that is
located in several other data sources.

Flat file location

The first step is to determine which file location you want to use to export and store your data.

Your Excel files might exist in one of the following locations:

 Local - You can import data from a local file into Power BI. The file isn't moved into
Power BI, and a link doesn't remain to it. Instead, a new dataset is created in Power BI,
and data from the Excel file is loaded into it. Accordingly, changes to the original Excel
file are not reflected in your Power BI dataset. You can use local data import for data
that doesn't change.
 OneDrive for Business - You can pull data from OneDrive for Business into Power
BI. This method is effective in 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.
 OneDrive - Personal - You can use data from files on a personal OneDrive account,
and get many of the same benefits that you would with OneDrive for Business.
However, you'll need to sign in with your personal OneDrive account, and select the
Keep me signed in option. Check with your system administrator to determine whether
this type of connection is allowed in your organization.
 SharePoint - Team Sites - Saving your Power BI Desktop files to SharePoint Team
Sites is similar to saving to OneDrive for Business. The main difference is how you
connect to the file from Power BI. You can specify a URL or connect to the root folder.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 16


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Using a cloud option such as OneDrive or SharePoint Team Sites is the most effective way to
keep your file and your dataset, reports, and dashboards in Power BI in-sync. However, if your
data does not change regularly, saving files on a local computer is a suitable option.

Connect to data in a file


In Power BI, on the Home tab, select Get data. In the list that displays, select the option that
you require, such as Text/CSV or XML. For this example, you will select Excel.

Tip

The Home tab contains quick access data source options, such as Excel, next to the Get data
button.

Depending on your selection, you need to find and open your data source. You might be
prompted to sign into a service, such as OneDrive, to authenticate your request. In this example,
you will open the Employee Data Excel workbook that is stored on the Desktop (Remember,
no files are provided for practice, these are hypothetical steps).

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 17


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Select the file data to import

After the file has connected to Power BI Desktop, the Navigator window opens. This window
shows you the data that is available in your data source (the Excel file in this example). You
can select a table or entity to preview its contents, to ensure that the correct data is loaded into
the Power BI model.

Select the check box(es) of the table(s) that you want to bring in to Power BI. This selection
activates the Load and Transform Data buttons as shown in the following image.

You now have the option to select the Load button to automatically load your data into the
Power BI model or select the Transform Data button to launch the Power Query Editor, where
you can review and clean your data before loading it into the Power BI model.

We often recommend that you transform data, but that process will be discussed later in this
module. For this example, you can select Load.

Change the source file

You might have to change the location of a source file for a data source during development,
or if a file storage location changes. To keep your reports up to date, you'll need to update your
file connection paths in Power BI.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 18


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Power Query provides a number of ways for you to accomplish this task, so that you can make
this type of change when needed.

1. Data source settings


2. Query settings
3. Advanced Editor

Warning

If you are changing a file path, make sure that you reconnect to the same file with the same file
structure. Any structural changes to a file, such as deleting or renaming columns in the source
file, will break the reporting model.

For example, try changing the data source file path in the data source settings. Select Data
source settings in Power Query. In the Data source settings window, select your file and then
select Change Source. Update the File path or use the Browse option to locate your file, select
OK, and then select Close.

2.3 Get data from relational data sources


If your organization uses a relational database to record its sales transactions, you can use
Power BI Desktop to establish a connection to your organization's relational database, rather
than getting data from individual flat files.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 19


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Connecting Power BI to your database will help you to monitor the progress of your business
and identify trends, so you can forecast sales figures, plan budgets and set performance
indicators and targets. Power BI Desktop can connect to many relational databases that are
either in the cloud or on-premises.

Scenario

The Sales team at Tailwind Traders have requested that you connect to the organization's on-
premises SQL Server database and get the sales data into Power BI Desktop so you can build
sales reports.

Connect to data in a relational database

You can use the Get data feature in Power BI Desktop and select the applicable option for
your relational database. For this example, you would select the SQL Server option, as shown
in the following screenshot.

Tip

Next to the Get Data button are quick access data source options, such as SQL Server.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 20


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Your next step is to enter your database server name and a database name in the SQL Server
database window. The two options in data connectivity mode are: Import (selected by default,
recommended) and DirectQuery. Mostly, you select Import. Other advanced options are also
available in the SQL Server database window, but you can ignore them for now.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 21


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

After you have added your server and database names, you will be prompted to sign in with a
username and password. You will have three sign-in options:

 Windows - Use your Windows account (Azure Active Directory credentials).


 Database - Use your database credentials. For instance, SQL Server has its own sign-
in and authentication system that is sometimes used. If the database administrator gave
you a unique sign-in to the database, you might need to enter those credentials on the
Database tab.
 Microsoft account - Use your Microsoft account credentials. This option is often used
for Azure services.

Select a sign-in option, enter your username and password, and then select Connect.

Select data to import

After the database has been connected to Power BI Desktop, the Navigator window displays
the data that is available in your data source (the SQL database in this example). You can select
a table or entity to preview its contents and make sure that the correct data will be loaded into
the Power BI model.

Select the check box(es) of the table(s) that you want to bring in to Power BI Desktop, and then
select either the Load or Transform Data option.

 Load - Automatically load your data into a Power BI model in its current state.
 Transform Data - Open your data in Microsoft Power Query, where you can perform
actions such as deleting unnecessary rows or columns, grouping your data, removing
errors, and many other data quality tasks.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 22


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Import data by writing an SQL query

Another way you can import data is to write an SQL query to specify only the tables and
columns that you need.

To write your SQL query, on the SQL Server database window, enter your server and
database names, and then select the arrow next to Advanced options to expand this section
and view your options. In the SQL statement box, write your query statement, and then select
OK. In this example, you will use the Select SQL statement to load the ID, NAME and
SALESAMOUNT columns from the SALES table.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 23


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Change data source settings

After you create a data source connection and load data into Power BI Desktop, you can return
and change your connection settings at any time. This action is often required due to a security
policy within the organization, for example, when the password needs to be updated every 90
days. You can change the data source, edit permissions or clear permissions.

On the Home tab, select Transform data, and then select the Data source settings option.

From the list of data sources that displays, select the data source that you want to update. Then,
you can right-click that data source to view the available update options or you can use the

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 24


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

update option buttons on the lower left of the window. Select the update option that you need,
change the settings as required, and then apply your changes.

You can also change your data source settings from within Power Query. Select the table, and
then select the Data source settings option on the Home ribbon. Alternatively, you can go to
the Query Settings panel on the right side of the screen and select the settings icon next to
Source (or double Select Source). In the window that displays, update the server and database
details, and then select OK.

After you have made the changes, select Close and Apply to apply those changes to your data
source settings.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 25


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Write an SQL statement

As previously mentioned, you can import data into your Power BI model by using an SQL
query. SQL stands for Structured Query Language and is a standardized programming language
that is used to manage relational databases and perform various data management operations.

Consider the scenario where your database has a large table that is comprised of sales data over
several years. Sales data from 2009 is not relevant to the report that you are creating. This
situation is where SQL is beneficial because it allows you to load only the required set of data
by specifying exact columns and rows in your SQL statement and then importing them into
your data model. You can also join different tables, run specific calculations, create logical
statements, and filter data in your SQL query.

The following example shows a simple query where the ID, NAME and SALESAMOUNT are
selected from the SALES table.

The SQL query starts with a Select statement, which allows you to choose the specific fields
that you want to pull from your database. In this example, you want to load the ID, NAME,
and SALESAMOUNT columns.

SQL
SELECT
ID
, NAME
, SALESAMOUNT
FROM

FROM specifies the name of the table that you want to pull the data from. In this case, it's the
SALES table. The following example is the full SQL query:

SQL
SELECT
ID
, NAME
, SALESAMOUNT
FROM
SALES

When using an SQL query to import data, try to avoid using the wildcard character (*) in your
query. If you use the wildcard character (*) in your SELECT statement, you import all columns
that you don't need from the specified table.

The following example shows the query using the wildcard character.

SQL
SELECT *
FROM
SALES

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 26


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The wildcard character (*) will import all columns within the Sales table. This method is not
recommended because it will lead to redundant data in your data model, which will cause
performance issues and require additional steps to normalize your data for reporting.

All queries should also have a WHERE clause. This clause will filter the rows to pick only
filtered records that you want. In this example, if you want to get recent sales data after Jan 1,
2020, add a WHERE clause. The evolved query would look like the following example.

SQL
SELECT
ID
, NAME
, SALESAMOUNT
FROM
SALES
WHERE
OrderDate >= ‘1/1/2020’

It is a best practice to avoid doing this directly in Power BI. Instead, consider writing a query
like this in a view. A view is an object in a relational database, similar to a table. Views have
rows and columns, and can contain almost every operator in the SQL language. If Power BI
uses a view, when it retrieves data, it participates in query folding, a feature of Power Query.
Query folding will be explained later, but in short, Power Query will optimize data retrieval
according to how the data is being used later.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 27


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

2.4 Get data from a NoSQL database


Some organizations don't use a relational database but instead use a NoSQL database. A NoSQL
database (also referred to as non-SQL, not only SQL or non-relational) is a flexible type of
database that does not use tables to store data.

Scenario

Software developers at Tailwind Traders created an application to manage shipping and


tracking products from their warehouses that uses Cosmos DB, a NoSQL database, as the data
repository. This application uses Cosmos DB to store JSON documents, which are open
standard file formats that are primarily used to transmit data between a server and web
application. You need to import this data into a Power BI data model for reporting.

Connect to a NoSQL database (Azure Cosmos DB)

In this scenario, you will use the Get data feature in Power BI Desktop. However, this time
you will select the More... option to locate and connect to the type of database that you use. In
this example, you will select the Azure category, select Azure Cosmos DB, and then select
Connect.

On the Preview Connector window, select Continue and then enter your database credentials.
In this example, on the Azure Cosmos DB window, you can enter the database details. You
can specify the Azure Cosmos DB account endpoint URL that you want to get the data from
(you can get the URL from the Keys blade of your Azure portal). Alternatively, you can enter
the database name, collection name or use the navigator to select the database and collection
to identify the data source.

If you are connecting to an endpoint for the first time, as you are in this example, make sure
that you enter your account key. You can find this key in the Primary Key box in the Read-
only Keys blade of your Azure portal.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 28


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Import a JSON file

JSON type records must be extracted and normalized before you can report on them, so you
need to transform the data before loading it into Power BI Desktop.

After you have connected to the database account, the Navigator window opens, showing a
list of databases under that account. Select the table that you want to import. In this example,
you will select the Product table. The preview pane only shows Record items because all
records in the document are represented as a Record type in Power BI.

Select the Edit button to open the records in Power Query.

In Power Query, select the Expander button to the right side of the Column1 header, which
will display the context menu with a list of fields. Select the fields that you want to load into
Power BI Desktop, clear the Use original column name as prefix checkbox, and then select
OK.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 29


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Review the selected data to ensure that you are satisfied with it, then select Close & Apply to
load the data into Power BI Desktop.

The data now resembles a table with rows and columns. Data from Cosmos DB can now be
related to data from other data sources and can eventually be used in a Power BI report.

2.5 Get data from online services


To support their daily operations, organizations frequently use a range of software applications,
such as SharePoint, OneDrive, Dynamics 365, Google Analytics and so on. These applications
produce their own data. Power BI can combine the data from multiple applications to produce
more meaningful insights and reports.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 30


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Scenario

Tailwind Traders uses SharePoint to collaborate and store sales data. It's the start of the new
financial year and the sales managers want to enter new goals for the sales team. The form that
the leadership uses exists in SharePoint. You are required to establish a connection to this data
within Power BI Desktop, so that the sales goals can be used alongside other sales data to
determine the health of the sales pipeline.

The following sections examine how to use the Power BI Desktop Get Data feature to connect
to data sources that are produced by external applications. To illustrate this process, an example
is provided that shows how to connect to a SharePoint site and import data from an online list.

Connect to data in an application

When connecting to data in an application, you would begin in the same way as you would
when connecting to the other data sources: by selecting the Get data feature in Power BI
Desktop. Then, select the option that you need from the Online Services category. In this
example, you select SharePoint Online List.

After you have selected Connect, you'll be asked for your SharePoint URL. This URL is the
one that you use to sign into your SharePoint site through a web browser. You can copy the
URL from your SharePoint site and paste it into the connection window in Power BI. You do
not need to enter your full URL file path; you only need to load your site URL because, when
you are connected, you can select the specific list that you want to load. Depending on the URL
that you copied, you might need to delete the last part of your URL, as illustrated in the
following image.

After you have entered your URL, select OK. Power BI needs to authorize the connection to
SharePoint, so sign in with your Microsoft account and then select Connect.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 31


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Choose the application data to import


After Power BI has made the connection with SharePoint, the Navigator window appears, as
it does when you connect to other data sources. The window displays the tables and entities
within your SharePoint site. Select the list that you want to load into Power BI Desktop. Similar
to when you import from other data sources, you have the option to automatically load your
data into Power BI model or launch the Power Query Editor to transform your data before
loading it.

For this example, you select the Load option.

2.6 Select a storage mode


The most popular way to use data in Power BI is to import it into a Power BI dataset. Importing
the data means that the data is stored in the Power BI file and gets published along with the
Power BI reports. This process helps make it easier for you to interact directly with your data.
However, this approach might not work for all organizations.

To continue with the scenario, you are building Power BI reports for the Sales department at
Tailwind Traders, where importing the data is not an ideal method. The first task you need to
accomplish is to create your datasets in Power BI so you can build visuals and other report
elements. The Sales department has many different datasets of varying sizes. For security
reasons, you are not allowed to import local copies of the data into your reports, so directly
importing data is no longer an option. Therefore, you need to create a direct connection to the
Sales department’s data source. The following section describes how you can ensure that these
business requirements are satisfied when you are importing data into Power BI.

However, sometimes there may be security requirements around your data that make it
impossible to directly import a copy. Or your datasets may simply be too large and would take
too long to load into Power BI, and you want to avoid creating a performance bottleneck. Power
BI solves these problems by using the DirectQuery storage mode, which allows you to query

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 32


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

the data in the data source directly and not import a copy into Power BI. DirectQuery is useful
because it ensures you are always viewing the most recent version of the data.

The three different types of storage modes you can choose from:

 Import
 DirectQuery
 Dual (Composite)

You can access storage modes by switching to the Model view, selecting a data table, and in
the resulting Properties pane, selecting which mode that you want to use from the Storage
mode drop-down list, as shown in the following visual.

Let’s take a closer look at the different types of Storage Modes.

Import mode

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.

DirectQuery mode

The DirectQuery option is useful when you do not want to save local copies of your data
because your data will not be cached. Instead, you can query the specific tables that you will
need by using native Power BI queries, and the required data will be retrieved from the
underlying data source. Essentially, you are creating a direct connection to the data source.
Using this model ensures that you are always viewing the most up-to-date data, and that all
security requirements are satisfied. Additionally, this mode is suited for when you have large
datasets to pull data from. Instead of slowing down performance by having to load large
amounts of data into Power BI, you can use DirectQuery to create a connection to the source,
solving data latency issues as well.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 33


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Dual (Composite mode)

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.

2.7 Get data from Azure Analysis Services


Azure Analysis Services is an Azure product that allows you to ingest data from multiple data
sources, build relationships between the data, and creates calculations on the data. The
calculations are built using data analysis expressions (DAX). Azure Analysis Services is
similar to the data modeling and storage technology in Power BI.

To resume the scenario, Tailwind Traders uses Azure Analysis Services to store financial
projection data. You’ve been asked to compare this data with actual sales data in a different
database. Getting data from Azure Analysis Services cubes is similar to getting data from SQL
Server, in that you can:

 Authenticate to the server.


 Pick the cube you want to use.
 Select which tables you need.

Notable differences between Azure Analysis Services cubes and SQL Server are:

 Analysis Services cubes have calculations already in the cube, which will be discussed in more detail
later.
 If you don’t need an entire table, you can query the data directly. Instead of using Transact-SQL (T-SQL)
to query the data, like you would in SQL Server, you can use multi-dimensional expressions (MDX) or
data analysis expressions (DAX).

Connect to data in Azure Analysis Services

As previously mentioned, you use the Get data feature in Power BI Desktop. When you select
Analysis Services, you are prompted for the server address and the database name with two
options: Import and Connect live.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 34


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Connect live is a new option in 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. Azure
Analysis Services can have a fast refresh schedule , which means that when data is refreshed
in the service, Power BI reports will immediately be updated, without the need to initiate a
Power BI refresh schedule. This process can improve the timeliness of the data in your report.

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.

You will likely import the data directly into Power BI. An acceptable alternative is to import
all other data that you want (from Excel, SQL Server, and so on) into the Azure Analysis
Services model and then use a live connection. Using this approach, the data modeling and
DAX measures are all performed in one place, and it's a much simpler and easier way to
maintain your solution.

2.8 Fix performance issues


Occasionally, organizations will need to address performance issues when running reports.
Power BI provides the Performance Analyzer tool to help fix problems and streamline the
process.

Consider the scenario where you are building reports for the Sales team in your organization.
You’ve imported your data, which is in several tables within the Sales team’s SQL database,
by creating a data connection to the database through DirectQuery. When you create
preliminary visuals and filters, you notice that some tables are queried faster than others, and
some filters are taking longer to process compared to others.

Optimize performance in Power Query

The performance in Power Query depends on the performance at the data source level. The
variety of data sources that Power Query offers is very wide, and the performance tuning
techniques for each source are equally wide. For instance, if you extract data from a Microsoft

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 35


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

SQL Server, you should follow the performance tuning guidelines for the product. Good SQL
Server performance tuning techniques include index creation, hardware upgrades, execution
plan tuning, and data compression. These topics are beyond the scope here, and are covered
only as an example to build familiarity with your data source and reap the benefits when using
Power BI and Power Query.

Power Query takes advantage of good performance at the data source through a technique
called Query Folding.

Query folding

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 are 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 do not overwhelm Power BI computing resources.

You can use Power Query to load data into Power BI. Using Power Query Editor you can then
make further transformations to your data, such as renaming or deleting columns, appending,
parsing, filtering, or grouping your data.

Consider a scenario where you’ve renamed a few columns in the Sales data and merged a city
and state column together in the “city state” format. Meanwhile, the query folding feature
tracks those changes in native queries. Then, when you load your data, the transformations take
place independently in the original source, this ensures that performance is optimized in Power
BI.

The benefits to query folding include:

 More efficiency in data refreshes and incremental refreshes. When you import data
tables by using query folding, Power BI is better able to allocate resources and refresh
the data faster because Power BI does not have to run through each transformation
locally.
 Automatic compatibility with DirectQuery and Dual storage modes. All
DirectQuery and Dual storage mode data sources must have the back-end server
processing abilities to create a direct connection, which means that query folding is an
automatic capability that you can use. If all transformations can be reduced to a single
Select statement, then query folding can occur.

The following scenario shows query folding in action. In this scenario, you apply a set of
queries to multiple tables. After you add a new data source by using Power Query, and you are
directed to the Power Query Editor, you go to the Query Settings pane and right-click the last
applied step, as shown in the following figure.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 36


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

If the View Native Query option is not available (not displayed in bold type), then query
folding is not possible for this step, and you will have to work backward in the Applied Steps
area until you reach the step in which View Native Query is available (displays in bold type).
This process will reveal the native query that is used to transform the dataset.

Native queries are not 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

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 37


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

A good guideline to remember is that if you can translate a transformation into a Select SQL
statement, which includes operators and clauses such as GROUP BY, SORT BY, WHERE,
UNION ALL, and JOIN, you can use query folding.

While query folding is one option to optimize performance when retrieving, importing, and
preparing data, another option is query diagnostics.

Query diagnostics

Another tool that you can use to study query performance is query diagnostics. This feature
allows you to determine what bottlenecks (if any) exist while loading and transforming your
data, refreshing your data in Power Query, running SQL statements in Query Editor, and so on.

To access query diagnostics in Power Query Editor, go to Tools in the Home ribbon. When
you are ready to begin transforming your data or making other edits in Power Query Editor,
select Start Diagnostics in the Session Diagnostics section. When you are finished, make sure
that you select Stop Diagnostics.

Selecting Diagnose Step shows you the length of time that it takes to run that step, as shown
in the following image. This selection can tell you if a step takes longer to complete than others,
which then serves as a starting point for further investigation.

This tool is useful when you want to analyze performance on the Power Query side for tasks
such as loading datasets, running data refreshes, or running other transformative tasks.

Other techniques to optimize performance

Other ways to optimize query performance in Power BI include:

 Process as much data as possible in the original data source. Power Query and
Power Query Editor allow you to process the data; however, the processing power that
is required to complete this task might lower performance in other areas of your reports.
Generally, a good practice is to process, as much as possible, in the native data source.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 38


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

 Use native SQL queries. When using DirectQuery for SQL databases, such as the case
for our scenario, make sure that you are not pulling data from stored procedures or
common table expressions (CTEs).
 Separate date and time, if bound together. If any of your tables have columns that
combine date and time, make sure that you separate them into distinct columns before
importing them into Power BI. This approach will increase compression abilities.

2.9 Resolve data import errors


While importing data into Power BI, you may encounter errors resulting from factors such as:

 Power BI imports from numerous data sources.


 Each data source might have dozens (and sometimes hundreds) of different error messages.
 Other components can cause errors, such as hard drives, networks, software services, and operating
systems.
 Data can often not comply with any specific schema.

The following sections cover some of the more common error messages that you might
encounter in Power BI.

Query timeout expired

Relational source systems often have many people who are concurrently using the same data
in the same database. Some relational systems and their administrators seek to limit a user from
monopolizing all hardware resources by setting a query timeout. These timeouts can be
configured for any timespan, from as little as five seconds to as much as 30 minutes or more.

For instance, if you’re pulling data from your organization’s SQL Server, you might see the
error shown in the following figure.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 39


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Power BI Query Error: Timeout expired

This error indicates that you’ve pulled too much data according to your organization’s policies.
Administrators incorporate this policy to avoid slowing down a different application or suite
of applications that might also be using that database.

You can resolve this error by pulling fewer columns or rows from a single table. While you are
writing SQL statements, it might be a common practice to include groupings and aggregations.
You can also join multiple tables in a single SQL statement. Additionally, you can perform
complicated subqueries and nested queries in a single statement. These complexities add to the
query processing requirements of the relational system and can greatly elongate the time of
implementation.

If you need the rows, columns, and complexity, consider taking small chunks of data and then
bringing them back together by using Power Query. For instance, you can combine half the
columns in one query and the other half in a different query. Power Query can merge those two
queries back together after you are finished.

We couldn't find any data formatted as a table

Occasionally, you may encounter the “We couldn’t find any data formatted as a table” error
while importing data from Microsoft Excel. Fortunately, this error is self-explanatory. Power
BI expects to find data formatted as a table from Excel. The error event tells you the resolution.
Perform the following steps to resolve the issue:

1. Open your Excel workbook, and highlight the data that you want to import.
2. Press the Ctrl-T keyboard shortcut. The first row will likely be your column headers.
3. Verify that the column headers reflect how you want to name your columns. Then, try
to import data from Excel again. This time, it should work.

Could not find file

While importing data from a file, you may get the "Could not find file" error.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 40


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Usually, this error is caused by the file moving locations or the permissions to the file changing.
If the cause is the former, you need to find the file and change the source settings.

1. Open Power Query by selecting the Transform Data button in Power BI.
2. Highlight the query that is creating the error.
3. On the left, under Query Settings, select the gear icon next to Source.

4. Change the file location to the new location.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 41


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Data type errors

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. The resolution to this
error is unique to the data source. For instance, if you are importing data from SQL Server and
see blank columns, you could try to convert to the correct data type in the query.

Instead of using this query:

SELECT CustomerPostalCode FROM Sales.Customers

Use this query:

SELECT CAST(CustomerPostalCode as varchar(10)) FROM Sales.Customers

By specifying the correct type at the data source, you eliminate many of these common data
source errors.

You may encounter different types of errors in Power BI that are caused by the diverse data
source systems where your data resides. If you encounter an error that was not discussed in the
preceding sections, you can search Microsoft documentation for the error message to find the
resolution you need.

Exercise - Prepare data in Power BI Desktop


This unit includes a lab to complete.

Use the free resources provided in the lab to complete the exercises in this unit. You will not
be charged.

Microsoft provides this lab experience and related content for educational purposes. All
presented information is owned by Microsoft and intended solely for learning about the
covered products and services in this Microsoft Learn module.

The estimated time to complete the exercise is 45 minutes.

Link to perform Exercise

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 42


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Note

A virtual machine containing the client tools you need is provided, along with the exercise
instructions. Use the button above to launch the virtual machine.

A limited number of concurrent sessions are available - if the hosted environment is


unavailable, try again later.

Check your knowledge


Answer the following questions to see what you've learned.
1. What type of expression do you use to extract data from Microsoft SQL Server?

DAX

T-SQL

True. T-SQL is the query language that you would use for SQL Server.

MDX
2. You're creating a Power BI report with data from an Azure Analysis Services Cube. When the data refreshes
in the cube, you would like to see it immediately in the Power BI report. How should you connect?

Import

T-SQL

Live connection

This will reflect cube changes immediately.

3. What can you do to improve performance when you're getting data in Power BI?

Use query folding

Power Query and Power Query Editor are built to allow you to process the data, however, the
processing power required to do this might lower performance in other areas of your reports.
It's good practice to process as much as possible in the native data source by using query
folding.

Only pull data into the Power BI service, not Power BI Desktop

Use the Select SQL statement in your SQL queries when you're pulling data from a relational database.

Combine date and time columns into a single column

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 43


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

2.10 Summary
In this module, you learned about pulling data from a number of different data sources and into
Power BI. You can pull data from files, relational databases, cubes, cloud-based applications,
websites, and more. Retrieving data from different data sources requires treating each data
source differently. For instance, Microsoft Excel data should be pulled in from an Excel table.
Relational databases often have query timeouts. You can connect to cubes with Connect live
which allows you to see data changes in real-time.

It is important to select the correct storage mode for your data. Do you require that visuals
interact quickly but don’t mind possibly refreshing the data when the underlying data source
changes? If so, select Import to import data into Power BI. If you prefer to see updates to data
as soon as they happen at the cost of interactivity performance, then choose Direct Query for
your data instead.

In addition, you learned how to solve performance problems and data import errors. You
learned that Power BI gives you tooling to identify where performance problems may exist.
Data import errors can be alarming at first, but you can see that the resolution is easily
implemented.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 44


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Unit 3:
Model data in Power BI

3.1 Introduction
Creating a great data model is one of the most important tasks that a data analyst can perform
in Microsoft Power BI. By doing this job well, you help make it easier for people to understand
your data, which will make building valuable Power BI reports easier for them and for you.

The pages in this module are instructional only, no data files are provided. You will have a
chance to work with real data in the labs.

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.

Providing set rules for what makes a good data model is difficult because all data is different,
and the usage of that data varies. Generally, a smaller data model is better because it will
perform faster and will be simpler to use. However, defining what a smaller data model entails
is equally as problematic because it's a heuristic and subjective concept.

Typically, a smaller data model is comprised of fewer tables and fewer columns in each table
that the user can see. If you import all necessary tables from a sales database, but the total table
count is 30 tables, the user will not find that intuitive. Collapsing those tables into five tables
will make the data model more intuitive to the user, whereas if the user opens a table and finds
100 columns, they might find it overwhelming. Removing unneeded columns to provide a more
manageable number will increase the likelihood that the user will read all column names. To
summarize, you should aim for simplicity when designing your data models.

The following image is an example data model. The boxes contain tables of data, where each
line item within the box is a column. The lines that connect the boxes represent relationships
between the tables. These relationships can be complex, even in such a simplistic model. The
data model can become easily disorganized, and the total table count in the model can gradually
increase. Keeping your data model simple, comprehensive, and accurate requires constant
effort.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 45


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Relationships are defined between tables through primary and foreign keys. Primary keys are
column(s) that identify each unique, non-null data row. For instance, if you have a Customers
table, you could have an index that identifies each unique customer. The first row will have an
ID of 1, the second row an ID of 2, and so on. Each row is assigned a unique value, which can
be referred to by this simple value: the primary key. This process becomes important when you
are referencing rows in a different table, which is what foreign keys do. Relationships between
tables are formed when you have primary and foreign keys in common between different tables.

Power BI allows relationships to be built from tables with different data sources, a powerful
function that enables you to pull one table from Microsoft Excel and another from a relational
database. You would then create the relationship between those two tables and treat them as a
unified dataset.

Now that you have learned about the relationships that make up the data schema, you'll be able
to explore a specific type of schema design, the star schema, which is optimized for high
performance and usability.

Star schemas

You can design a star schema to simplify your data. It's not the only way to simplify your data,
but it is a popular method; therefore, every Power BI data analyst should understand it. In a
star schema, each table within your dataset is defined as a dimension or a fact table, as shown
in the following visual.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 46


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Fact tables contain observational or event data values: sales orders, product counts, prices,
transactional dates and times, and quantities. Fact tables can contain several repeated values.
For example, one product can appear multiple times in multiple rows, for different customers
on different dates. These values can be aggregated to create visuals. For instance, a visual of
the total sales orders is an aggregation of all sales orders in the fact table. With fact tables, it is
common to see columns that are filled with numbers and dates. The numbers can be units of
measurement, such as sale amount, or they can be keys, such as a customer ID. The dates
represent time that is being recorded, like order date or shipped date.

Dimension tables contain the details about the data in fact tables: products, locations,
employees, and order types. These tables are connected to the fact table through key columns.
Dimension tables are used to filter and group the data in fact tables. The dimension tables, by
contrast, contain unique values, for instance, one row for each product in the Products table
and one row for each customer in the Customer table. For the total sales orders visual, you
could group the data so that you see total sales orders by product, in which product is data in
the dimension table.

Fact tables are usually much larger than dimension tables because numerous events occur in
fact tables, such as individual sales. Dimension tables are typically smaller because you are
limited to the number of items that you can filter and group on. For instance, a year contains
only so many months, and the United States is comprised of only a certain number of states.

Considering this information about fact tables and dimension tables, you might wonder how
you can build this visual in Power BI.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 47


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The pertinent data resides in two tables, Employee and Sales, as shown in the following data
model. Because the Sales table contains the sales order values, which can be aggregated, it is
considered a fact table. The Employee table contains the specific employee name, which filters
the sales orders, so it would be a dimension table. The common column between the two tables,
which is the primary key in the Employee table, is EmployeeID, so you can establish a
relationship between the two tables based on this column.

When creating this relationship, you can build the visual according to the requirements, as
shown in the following figure. If you did not establish this relationship, while keeping in mind
the commonality between the two tables, you would have had more difficulty building your
visual.

Star schemas and the underlying data model are the foundation of organized reports; the more
time you spend creating these connections and design, the easier it will be to create and
maintain reports.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 48


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

2.2 Work with tables


When users see fewer tables, they will enjoy using your data model considerably more. For
example, suppose you've imported dozens of tables from many data sources and now the visual
appears disorderly. In this case, you need to ensure that, before you begin working on building
reports, your data model and table structure are simplified.

A simple table structure will:

 Be simple to navigate because of column and table properties that are specific and user-
friendly.
 Have merged or appended tables to simplify the tables within your data structure.
 Have good-quality relationships between tables that make sense.

The following sections further explain how you might work with your tables to ensure a simple
and readable table structure.

Configure data model and build relationships between tables

Assuming that you've already retrieved your data and cleaned it in Power Query, you can then
go to the Model tab, where the data model is located. The following image shows how the
relationship between the Order and Sales tables can be seen through the OrderDate column.

To manage these relationships, go to Manage Relationships on the ribbon, where the


following window will appear.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 49


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

In this view, you can create, edit, and delete relationships between tables and also autodetect
relationships that already exist. When you load your data into Power BI, the Autodetect feature
will help you establish relationships between columns that are named similarly. Relationships
can be inactive or active. Only one active relationship can exist between tables, which is
discussed in a future module.

While the Manage Relationships feature allows you to configure relationships between tables,
you can also configure table and column properties to ensure organization in your table
structure.

Configure table and column properties

The Model view in Power BI desktop provides many options within the column properties that
you can view or update. A simple method to get to this menu to update the tables and fields is
by Ctrl+clicking or Shift+clicking items on this page.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 50


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

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.

For instance, suppose that the dates in your column are formatted, as seen in the previous
screenshot, in the form of "Wednesday, March 14, 2001". If you want to change the format so
that the date was in the "mm/dd/yyyy" format, you would select the drop-down menu under
All date time formats and then choose the appropriate date format, as shown in the
following figure.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 51


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 52


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

After selecting the appropriate date format, return to the Date column, where you should see
that the format has indeed changed, as shown in the following figure.

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.

Additionally, Power BI has a new functionality to update these properties on many tables and
fields by Ctrl+clicking or Shift+clicking items.

These examples are only some of the many types of transformations that you can make to
simplify the table structure. This step is important to take before you begin making your
visuals so that you don't have to go back and forth when making formatting changes. This
process of formatting and configuring tables can also be done in Power Query.

2.3 Create a date table


During report creation in Power BI, a common business requirement is to make calculations
based on date and time. Organizations want to know how their business is doing over months,
quarters, fiscal years, and so on. For this reason, it is crucial that these time-oriented values are
formatted correctly. Power BI autodetects for date columns and tables; however, situations can
occur where you will need to take extra steps to get the dates in the format that your
organization requires.

For example, suppose that you are developing reports for the Sales team at your organization.
The database contains tables for sales, orders, products, and more. You notice that many of
these tables, including Sales and Orders, contain their own date columns, as shown by the

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 53


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

ShipDate and OrderDate columns in the Sales and Orders tables. You are tasked with
developing a table of the total sales and orders by year and month. How can you build a visual
with multiple tables, each referencing their own date columns?

To solve this problem, you can create a common date table that can be used by multiple tables.
The following section explains how you can accomplish this task in Power BI.

Create a common date table

Ways that you can build a common date table are:

 Source data
 DAX
 Power Query

Source data

Occasionally, source databases and data warehouses already have their own date tables. If the
administrator who designed the database did a thorough job, these tables can be used to perform
the following tasks:

 Identify company holidays


 Separate calendar and fiscal year
 Identify weekends versus weekdays

Source data tables are mature and ready for immediate use. If you have a table as such, bring
it into your data model and don't use any other methods that are outlined in this section. We
recommend that you use a source date table because it is likely shared with other tools that you
might be using in addition to Power BI.

If you do not have a source data table, you can use other ways to build a common date table.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 54


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

DAX

You can use the Data Analysis Expression (DAX) functions CALENDARAUTO() or
CALENDAR() to build your common date table. The CALENDAR() function returns a
contiguous range of dates based on a start and end date that are entered as arguments in the
function. Alternatively, the CALENDARAUTO() function returns a contiguous, complete
range of dates that are automatically determined from your dataset. The starting date is chosen
as the earliest date that exists in your dataset, and the ending date is the latest date that exists
in your dataset plus data that has been populated to the fiscal month that you can choose to
include as an argument in the CALENDARAUTO() function. For the purposes of this example,
the CALENDAR() function is used because you only want to see the data from May 31, 2011
(the first day that Sales began its tracking of this data) and forward for the next 10 years.

In Power BI Desktop, go to the Table tab on the ribbon. Select New Table, and then enter in
the following DAX formula:

DAX
Dates = CALENDAR(DATE(2011, 5, 31), DATE(2022, 12, 31))

Now, you have a column of dates that you can use. However, this column is slightly sparse.
You also want to see columns for just the year, the month number, the week of the year, and
the day of the week. You can accomplish this task by selecting New Column on the ribbon
and entering the following DAX equation, which will retrieve the year from your Date table.

DAX
Year = YEAR(Dates[Date])

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 55


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You can perform the same process to retrieve the month number, week number, and day of the
week:

DAX
MonthNum = MONTH(Dates[Date])
DAX
WeekNum = WEEKNUM(Dates[Date])
DAX
DayoftheWeek = FORMAT(Dates[Date], "DDDD")

When you have finished, your table will contain the columns that are shown in the following
figure.

You have now created a common date table by using DAX. This process only adds your new
table to the data model; you will still need to establish relationships between your date table
and the Sales and Order tables, and then mark your table as the official date table of your data
model. However, before you complete those tasks, make sure that you consider another way of
building a common date table: by using Power Query.

Power Query

You can use M-language, the development language that is used to build queries in Power
Query, to define a common date table.

Select Transform Data in Power BI Desktop, which will direct you to Power Query. In the
blank space of the left Queries pane, right-click to open the following drop-down menu, where
you will select New Query > Blank Query.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 56


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

In the resulting New Query view, enter the following M-formula to build a calendar table:

MDX
= List.Dates(#date(2011,05,31), 365*10, #duration(1,0,0,0))

For your sales data, you want the start date to reflect the earliest date that you have in your
data: May 31, 2011. Additionally, you want to see dates for the next 11 years, including dates
in the future. This approach ensures that, as new sales data flows in, you won't have to re-create
this table. You can also change duration. In this case, you want a data point for every day, but
you can also increment by hours, minutes, and seconds. The following figure shows the result.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 57


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

After you have realized success in the process, you notice that you have a list of dates instead
of a table of dates. To correct this error, go to the Transform tab on the ribbon and select
Convert > To Table. As the name suggests, this feature will convert your list into a table. You
can also rename the column to DateCol.

Next, you want to add columns to your new table to see dates in terms of year, month, week,
and day so that you can build a hierarchy in your visual. Your first task is to change the column

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 58


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

type by selecting the icon next to the name of the column and, in the resulting drop-down menu,
selecting the Date type.

After you have finished selecting the Date type, you can add columns for year, months, weeks,
and days. Go to Add Column, select the drop-down menu under Date, and then select Year,
as shown in the following figure.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 59


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Notice that Power BI has added a column of all years that are pulled from DateCol.

Complete the same process for months, weeks, and days. After you have finished this process,
the table will contain the columns that are shown in the following figure.

You have now successfully used Power Query to build a common date table.

The previous steps show how to get the table into the data model. Now, you need to mark your
table as the official date table so that Power BI can recognize it for all future values and ensure
that formatting is correct.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 60


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Mark as the official date table

Your first task in marking your table as the official date table is to find the new table on the
Fields pane. Right-click the name of the table and then select Mark as date table, as shown
in the following figure.

By marking your table as a date table, Power BI performs validations to ensure that the data
contains zero null values, is unique, and contains continuous date values over a period. You
can also choose specific columns in your table to mark as the date, which can be useful when
you have many columns within your table. Right-click the table, select Mark as date table,
and then select Date table settings. The following window will appear, where you can choose
which column should be marked as Date.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 61


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Selecting Mark as date table will remove autogenerated hierarchies from the Date field in the
table that you marked as a date table. For other date fields, the auto hierarchy will still be
present until you establish a relationship between that field and the date table or until you turn
off the Auto Date/Time feature. You can manually add a hierarchy to your common date table
by right-clicking the year, month, week, or day columns in the Fields pane and then selecting
New hierarchy. This process is further discussed later in this module.

Build your visual

To build your visual between the Sales and Orders tables, you will need to establish a
relationship between this new common date table and the Sales and Orders tables. As a result,
you will be able to build visuals by using the new date table. To complete this task, go to Model
tab > Manage Relationships, where you can create relationships between the common date
table and the Orders and Sales tables by using the OrderDate column. The following
screenshot shows an example of one such relationship.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 62


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

After you have built the relationships, you can build your Total Sales and Order Quantity by
Time visual with your common date table that you developed by using the DAX or Power
Query method.

To determine the total sales, you need to add all sales because the Amount column in the Sales
table only looks at the revenue for each sale, not the total sales revenue. You can complete this
task by using the following measure calculation, which will be explained in later discussions.
The calculation that you will use when building this measure is as follows:

DAX
#Total Sales = SUM(Sales[‘Amount’])

After you have finished, you can create a table by returning to the Visualizations tab and
selecting the Table visual. You want to see the total orders and sales by year and month, so
you only want to include the Year and Month columns from your date table, the OrderQty
column, and the #TotalSales measure. When you learn about hierarchies, you can also build a
hierarchy that will allow you drill down from years to months. For this example, you can view
them side-by-side. You have now successfully created a visual with a common date table.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 63


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

3.4 Work with dimensions


When building a star schema, you will have dimension and fact tables. Fact tables contain
information about events such as sales orders, shipping dates, resellers, and suppliers.
Dimension tables store details about business entities, such as products or time, and are
connected back to fact tables through a relationship.

You can use hierarchies as one source to help you find detail in dimension tables. These
hierarchies form through natural segments in your data. For instance, you can have a hierarchy
of dates in which your dates can be segmented into years, months, weeks, and days. Hierarchies
are useful because they allow you to drill down into the specifics of your data instead of only
seeing the data at a high level.

Hierarchies

When you are building visuals, Power BI automatically enters values of the date type as a
hierarchy (if the table has not been marked as a date table).

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 64


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

In the preceding Date column, the date is shown in increasingly finer detail through year,
quarters, months, and days. You can also manually create hierarchies.

For example, consider a situation where you want to create a stacked bar chart of Total Sales
by Category and Subcategory. You can accomplish this task by creating a hierarchy in the
Product table for categories and subcategories. To create a hierarchy, go to the Fields pane on
Power BI and then right-click the column that you want the hierarchy for. Select New
hierarchy, as shown in the following figure.

Next, drag and drop the subcategory column into this new hierarchy that you've created. This
column will be added as a sublevel on the hierarchy.

Now, you can build the visual by selecting a stacked bar chart in the Visualizations pane. Add
your Category Name Hierarchy in the Axis field and Total Sales in the Values field.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 65


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You can drill down on the visual to view both Category and Subcategory, depending on what
you want to see. Hierarchies allow you to view increasing levels of data on a single view.

Now that you have learned about hierarchies, you can take a step further and examine parent-
child hierarchies and their role in multiple relationships between fact tables and dimension
tables.

Parent-child hierarchy

In the following example, you have an Employee table within the database that tells you
important information about the employees, their managers, and their IDs. When looking at
this table, you notice that Roy F has been repeated multiple times in the Manager column. As
the image shows, multiple employees can have the same manager, which indicates a hierarchy
between managers and employees.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 66


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The Manager column determines the hierarchy and is therefore the parent, while the "children"
are the employees. For this example, you want to be able to see all levels of this hierarchy.
Power BI does not default to showing you all levels of the hierarchy, so it is your responsibility
to ensure that you see all levels of this hierarchy or "flatten" it so that you can see more data
granularity.

Flatten parent-child hierarchy

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.

Important

DAX has not been covered yet; however, it will be in another module. This function is included
in this section because it's explaining hierarchies. If use of DAX in this capacity is confusing,
refer to the DAX module and then return to this section afterward.

While on the table, go to the Modeling tab and select New Column. In the resulting formula
bar, enter the following function, which creates the text path between the employee and
manager. This action creates a calculated column in DAX.

DAX
Path = PATH(Employee[Employee ID], Employee[Manager ID])

The completed path between the employee and the manager appears in the new column, as
shown in the following screenshot.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 67


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

If you look at Roger M, the path of IDs is 1010 | 1011 | 1013, which means that one level above
Roger M (ID 1013) is his manager, Pam H (ID 1011), and one level above Pam H is her
manager Roy F (ID 1010). In this row, Roger M is on the bottom of the hierarchy, at the child
level, and Roy F is at the top of the hierarchy and is at the parent level. This path is created for
every employee. To flatten the hierarchy, you can separate each level by using the PATHITEM
function.

To view all three levels of the hierarchy separately, you can create four columns in the same
way that you did previously, by entering the following equations. You will use the PATHITEM
function to retrieve the value that resides in the corresponding level of your hierarchy.

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

After you have finished, notice that you now have each level of hierarchy within your table.
Roy F is at the top of the hierarchy and, as you go through Levels 2-3, notice that the managers
and employees map with each other.

Now, you can create a hierarchy on the Fields pane, as you did previously. Right-click Level
1, because this is the first hierarchy level, and then select New Hierarchy. Then, drag and drop
Level 2 and Level 3 into this hierarchy.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 68


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You have now successfully flattened a hierarchy so that you can view individual levels.

Previously, you've considered dimensions that have only one relationship with a fact table.
However, situations do occur where your dimension table will have multiple relationships with
a fact table.

Role-playing dimensions

Role-playing dimensions have multiple valid relationships with fact tables, meaning that the
same dimension can be used to filter multiple columns or tables of data. As a result, you can
filter data differently depending on what information you need to retrieve. This topic is
complex, so it is only introduced in this section. Working with role-playing dimensions requires
complex DAX functions that will be discussed in later sections.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 69


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The preceding visual shows the Calendar, Sales, and Order tables. Calendar is the dimension
table, while Sales and Order are fact tables. The dimension table has two relationships: one
with Sales and one with Order. This example is of a role-playing dimension because the
Calendar table can be used to group data in both Sales and Order. If you wanted to build a
visual in which the Calendar table references the Order and the Sales tables, the Calendar table
would act as a role-playing dimension.

3.5 Define data granularity


Data granularity is the detail that is represented within your data, meaning that the more
granularity your data has, the greater the level of detail within your data.

Data granularity is an important topic for all data analysts, regardless of the Power BI tools that
you are using. Defining the correct data granularity can have a big impact on the performance
and usability of your Power BI reports and visuals.

Data granularity defined

Consider a scenario where your company manages 1,000 refrigerated semi-trucks. Every few
minutes, each truck uses a Microsoft Azure IoT application to record its current temperature.
This temperature is important to your organization because, if the refrigeration were to
malfunction, it could spoil the entire load, costing thousands of dollars. With so many trucks

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 70


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

and so many sensors, extensive data is generated every day. Your report users don't want to sift
through numerous records to find the ones that they are particularly interested in.

How can you change the granularity of the data to make the dataset more usable?

In this scenario, you might want to import the data by using a daily average for each truck. That
approach would reduce the records in the database to one record for each truck for each day. If
you decide that the approach was acceptable enough for tracking costs and errors, then you
could use that data granularity. Alternatively, you could select the last recorded temperature,
or you could only import records that are above or below a normal range of temperatures. Any
of these methods will reduce the total records that you import, while still bringing in data that
is comprehensive and valuable.

For different scenarios, you could settle on data granularity that is defined weekly, monthly, or
quarterly. Generally, the fewer the records that you are working with, the faster your reports
and visuals will function. This approach translates to a faster refresh rate for the entire dataset,
which might mean that you can refresh more frequently.

However, that approach has a drawback. If your users want to drill into every single transaction,
summarizing the granularity will prevent them from doing that, which can have a negative
impact on the user experience. It is important to negotiate the level of data granularity with
report users so they understand the implications of these choices.

Change data granularity to build a relationship between two tables

Data granularity can also have an impact when you are building relationships between tables
in Power BI.

For example, consider that you are building reports for the Sales team at Tailwind Traders. You
have been asked to build a matrix of total sales and budget over time by using the Calendar,
Sales, and Budget tables. You notice that the lowest level of time-based detail that the Sales
table goes into is by day, for instance 5/1/2020, 6/7/2020, and 6/18/2020. The Budget table
only goes to the monthly level, for instance, the budget data is 5/2020 and 6/2020.These tables
have different granularities that need to be reconciled before you can build a relationship
between tables.

The following figure shows your current data model.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 71


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

As shown in the preceding figure, a relationship between Budget and Calendar is missing.
Therefore, you need to create this relationship before you can build your visual. Notice that if
you transform the Year and Month columns in the Calendar table into a new column, and do
the same transformation in the Budget table, you can match the format of the Date column in
the Calendar table. Then, you can establish a relationship between the two columns. To
complete this task, you will concatenate the Year and Month columns and then change the
format.

Select Transform Data on the ribbon. On Applied Steps, on the right pane, right-click the last
step and then select Insert Step After.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 72


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Under Add Column on the Home ribbon, select Custom Column. Enter the following
equation, which will concatenate the Year and Month columns, and then add a dash in between
the column names.

M
Column = Table.AddColumn(#"Renamed Columns", "Custom", each [Year] & "-"
&[Month])

Change the data type to Date and then rename the column. Your Budget table should resemble
the following figure.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 73


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Now, you can create a relationship between the Budget and the Calendar tables.

Create a relationship between tables

Power BI automatically detects relationships, but you can also go to Manage Relationships >
New and create the relationship on the Date column. The relationship should resemble the
following figure.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 74


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

By completing this task, you have ensured that the granularity is the same between your
different tables. Now, you need to create DAX measures to calculate Total Sales and
BudgetAmount. Go to the Data pane on Power BI Desktop, select New Measure, and then
create two measures with the following equations:

DAX
TotalSales = SUM(Sales[Total Sales])
DAX
BudgetAmount = SUM (Budget[BudgetAmount])

Select the table visual on the Visualization pane, and then enter these measures and the Date
into the Values field. You have now accomplished the goal of building a matrix of the total
sales and budgets over time.

3.6 Work with relationships and cardinality


Unlike other database management systems, Power BI has the concept of directionality to a
relationship. This directionality plays an important role in filtering data between multiple

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 75


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

tables. When you load data, Power BI automatically looks for relationships that exist within
the data by matching column names. You can also use Manage Relationships to edit these
options manually.

For example, you've retrieved many tables from the Sales database, and the following image is
an example of your data model. Power BI has autodetected several relationships, but you can't
discern what they mean. You want to make sure that the relationships accurately reflect those
that exist in your data.

Relationships

The following are different types of relationships that you'll find in Power BI.

Many-to-one (*:1) or one-to-many (1: *) relationship

 Describes a relationship in which you have many instances of a value in one column
that are related to only one unique corresponding instance in another column.
 Describes the directionality between fact and dimension tables.
 Is the most common type of directionality and is the Power BI default when you are
automatically creating relationships.

An example of a one-to-many relationship would be between the CountryName and Territory


tables, where you can have many territories that are associated with one unique country.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 76


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

One-to-one (1:1) relationship:

 Describes a relationship in which only one instance of a value is common between two
tables.
 Requires unique values in both tables.
 Is not recommended because this relationship stores redundant information and
suggests that the model is not designed correctly. It is better practice to combine the
tables.

An example of a one-to-one relationship would be if you had products and product IDs in two
different tables. Creating a one-to-one relationship is redundant and these two tables should be
combined.

Many-to-many (.) relationship:

 Describes a relationship where many values are in common between two tables.
 Does not require unique values in either table in a relationship.
 Is not recommended; a lack of unique values introduces ambiguity and your users might
not know which column of values is referring to what.

For instance, the following figure shows a many-to-many relationship between the Sales and
Order tables on the OrderDate column because multiple sales can have multiple orders
associated with them. Ambiguity is introduced because both tables can have the same order
date.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 77


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Cross-filter direction

Data can be filtered on one or both sides of a relationship.

With a single cross-filter direction:

 Only one table in a relationship can be used to filter the data. For instance, Table 1 can
be filtered by Table 2, but Table 2 cannot be filtered by Table 1.

Tip

Follow the direction of the arrow on the relationship between your tables to know which
direction the filter will flow. You typically want these arrows to point to your fact table.

 For a one-to-many or many-to-one relationship, the cross-filter direction will be from


the "one" side, meaning that the filtering will occur in the table that has many values.

With both cross-filter directions or bi-directional cross-filtering:

 One table in a relationship can be used to filter the other. For instance, a dimension
table can be filtered through the fact table, and the fact tables can be filtered through
the dimension table.
 You might have lower performance when using bi-directional cross-filtering with
many-to-many relationships.

A word of caution regarding bi-directional cross-filtering: You should not enable bi-directional
cross-filtering relationships unless you fully understand the ramifications of doing so. Enabling
it can lead to ambiguity, over-sampling, unexpected results, and potential performance
degradation.

Cardinality and cross-filter direction

For one-to-one relationships, the only option that is available is bi-directional cross-filtering.
Data can be filtered on either side of this relationship and result in one distinct, unambiguous
value. For instance, you can filter on one Product ID and be returned a single Product, and you
can filter on a Product and be returned a single Product ID.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 78


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

For many-to-many relationships, you can choose to filter in a single direction or in both
directions by using bi-directional cross-filtering. The ambiguity that is associated with bi-
directional cross-filtering is amplified in a many-to-many relationship because multiple paths
will exist between different tables. If you create a measure, calculation, or filter, unintended
consequences can occur where your data is being filtered and, depending on which relationship
that the Power BI engine chooses when applying the filter, the final result might be different.
This situation is also true for bi-directional relationships and why you should be cautious when
using them.

For this reason, many-to-many relationships and/or bi-directional relationships are


complicated. Unless you are certain what your data looks like when aggregated, these types of
open-ended relationships with multiple filtering directions can introduce multiple paths
through the data.

Create many-to-many relationships

Consider the scenario where you are tasked with building a visual that examines budgets for
customers and accounts. You can have multiple customers on the same account and multiple
accounts with the same customer, so you know that you need to create a many-to-many
relationship.

To create this relationship, go to Manage Relationships > New. In the resulting window,
create a relationship between the Customer ID column in CustomerTable and AccountTable.
The relationship is set to many-to-many, and the filter type is in both directions. Immediately,
you will be warned that you should only use this type of relationship if it is expected that neither
column will have unique values because you might get unexpected values. Because you want
to filter in both directions, choose bi-directional cross-filtering.

Select OK. You have now successfully created a many-to-many relationship.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 79


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

3.7 Resolve modeling challenges


Completed 100 XP

 2 minutes

Modeling data is about establishing and maintaining relationships so that you can effectively
visualize the data in the form that your business requires. When you are creating these
relationships, a common pitfall that you might encounter are circular relationships.

For example, you are developing reports for the Sales team and are examining the relationships
between tables. In a poorly designed data model, Table 1 has a many-to-one relationship with
a column in Table 2, but Table 2 has a one-to-many relationship with Table 3 that has its own
relationship with Table 1. This web of relationships is difficult to manage and becomes a
daunting task to build visuals because it is no longer clear what relationships exist. Therefore,
it is important that you are able to identify circular relationships so that your data is usable.

Relationship dependencies

To understand circular relationships, you first need to understand dependencies.

For example, consider that you have the following calculated column Total in the Sales table.

Sales[‘TotalCost'] = Sales[‘Quantity’] * Sales[‘Price’]

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 80


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

TotalCost depends on Quantity and Price, so if a change occurs in either quantity or price, a
change will occur in TotalCost as well. This example outlines a dependency of a column on
other columns, but you can also have dependencies between measures, tables, and
relationships.

Consider the following relationships between SalesPerson, Sales, and Customer. A change in
Customer will result in a change in Sales, which results in changes in SalesPerson. These
types of dependencies can exist within relationships.

Exercise - Model data in Power BI Desktop, Part 1


This unit includes a lab to complete.

Use the free resources provided in the lab to complete the exercises in this unit. You will not
be charged.

Microsoft provides this lab experience and related content for educational purposes. All
presented information is owned by Microsoft and intended solely for learning about the covered
products and services in this Microsoft Learn module.

Access your environment

Before you start this lab (unless you are continuing from a previous lab), select Launch lab
above.

You are automatically logged in to your lab environment as data-ai\student.

You can now begin your work on this lab.

Tip: To dock the lab environment so that it fills the window, select the PC icon at the top and
then select Fit Window to Machine.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 81


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The estimated time to complete the lab is 45 minutes.

Note

A virtual machine containing the client tools you need is provided, along with the exercise
instructions. Use the button above to launch the virtual machine.

A limited number of concurrent sessions are available - if the hosted environment is


unavailable, try again later.

Alternatively, you can use these setup instructions to create your own lab environment, then
follow these exercise instructions.

Check your knowledge


Answer the following questions to see what you've learned.
1. What does data granularity mean?

Data granularity is the filter direction that is associated with the relationship between two columns.

Data granularity is the level of detail that is represented in the data.

Data granularity indicates the level the detail within the data, so the higher the granularity, the
more detail that is represented in the data.

Data granularity is a many-to-many relationship.

Data granularity is a type of schema design.


2. What is the difference between a fact table and a dimension table?

Fact tables contain observational data while dimension tables contain information about specific entities
within the data.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 82


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Fact tables contain observational data such as sales orders, employees, shipping dates, and so
on, while dimension tables contain information about specific entities such as product IDs and
dates.

Fact tables contain information about specific entities while dimension tables contain informatin about
observational data.

There is no difference.

Dimension tables tell you about specific roles in Power BI while fact tables tell you information about facts
that are associated with those roles in Power BI.
3. What is cardinality?

Cardinality is the measure of unique values in a table.

An example of high cardinality would be a Sales table as it has a high number of unique values.

Cardinality is the granularity of the data.

Cardinality is how long it takes for the data to load.

Cardinality is a type of visual element.

Summary
You have learned about modeling data in Power BI, which includes such topics as creating
common date tables, learning about and configuring many-to-many relationships, resolving
circular relationships, designing star schemas, and much more. These skills are crucial to the
Power BI practitioner's toolkit so that it is easier to build visuals and hand off your report
elements to other teams. With this foundation, you now have the ability to explore the many
nuances of the data model.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 83


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Unit 4:
Visualize data in Power BI

4.1 Introduction to work with Power BI visuals


Power BI visuals are attractive charts and graphics that you can use to revitalize your data.
Visuals allow you to share data insights more effectively and increase comprehension,
retention, and appeal. Visuals are a fundamental part of your report because they help your
report audience connect and interact with the information to make informed decisions quickly.

After you've loaded and modeled your organization's data in Power BI Desktop, you will be
ready to start creating your reports. In this module, you'll use the report editor in Power BI
Desktop to add suitable visuals to your report canvas. You'll then customize those visuals to
meet your organization's requirements.

Consider a scenario where you work as a Power BI developer for Tailwind Traders. Your
organization wants to transform the way that it presents its data to management and
stakeholders. It wants to replace the current text and tabular report format with a more visual
approach so that users will find the reports more interesting. Additionally, by using a visual
approach, the company can provide users with quicker, easier access to the information that
they need to make their business decisions. You are tasked with creating a Power BI report that
is based on a combination of visuals that are customized to match your organization's branding
and report presentation requirements.

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

 Add visualization items to reports.


 Choose an effective visualization.
 Format and configure visualizations.
 Import a custom visual.
 Add an R or Python visual.

4.2 Add visualization items to reports


Power BI has a variety of visuals that you can use to report on the data in your data model.
Visuals allow you to present the important information and insights that you discovered in the
data in a compelling and insightful way. The report consumers rely on these visualizations as
a gateway to the underlying data.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 84


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

In Power BI Desktop, each visual is represented by an icon in the Visualizations pane. The
types of visuals that are available include charts, maps, cards, a table, a matrix, and many more.
You will learn how to select the correct visual later in this module.

This module is instructional, you will have an opportunity to practice in the lab near the end of
the module.

In this example, you want to add a visualization to the report that displays sales data by category
name. You start by selecting the Category and Revenue fields in the Fields pane. Power BI
Desktop then automatically selects a visualization for you, depending on the data type of the
fields that you selected. In this case, the default visualization type is a table.

While the visual is selected, you can change the visualization type by selecting a different
visual from the Visualizations pane.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 85


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

4.3 Choose an effective visualization


Power BI Desktop offers a range of out-of-the-box visualization options that are available
directly from the Visualizations pane. When you select the fields that you want to display in a
visualization, you can experiment with all the different visualization types to find the one that
best suits your needs. If you can't find a visual that meets your needs, you can download other
visuals from Microsoft AppSource or import your own custom visuals.

Depending on the type of data in your selected fields, one or more visualizations might not be
suitable. For example, geographic data will not display well as a funnel chart or line chart
visualization.

It is important that you choose an effective visualization to ensure that you display the data in
the best way possible. The following sections outline the different types of visualizations that
are available within Power BI Desktop, using the same data source for illustration purposes.

Table and Matrix visualizations

In the previous example, the Table visualization was selected by default. The table is a grid
that contains related data in a logical series of rows and columns. The table supports two
dimensions and it can also contain headers and a row for totals.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 86


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The Matrix visualization looks similar to the table visualization; however, it allows you to
select one or more elements (rows, columns, values) in the matrix to cross-highlight other
visuals on the report page. In the following image, notice that a new field called Product Color
was added to the columns, and the available colors are now spanning across the table, with the
categories listed in rows.

Bar and column charts

Power BI Desktop has a variety of bar and column chart visualizations that present specific
data across different categories in a stacked or clustered format. The stacked format will stack
the information items on top of each other.

For example, the following clustered column chart shows a single column with total sales for
each country, whereas the stacked column chart shows data for sales by country, by product

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 87


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

name. All sales data is stacked into one column to show you the total sales by country, broken
down by how much each product contributed to the overall total sales.

Line and area charts

The line chart and area chart visualizations are beneficial in helping you present trends over
time. The basic area chart is based on the line chart, with the area between axis and line filled
in. The main difference between these two chart types is that the area chart highlights the
magnitude of change over time.

Pie chart, donut chart, and Treemaps

The pie chart, donut chart, and Treemap visualizations show you the relationship of parts to
the whole by dividing the data into segments. From a data analysis perspective, these charts
are not useful because interpreting the data that they present can be difficult. However, these

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 88


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

charts are often used for aesthetic reasons due to the colorful segments that they display. These
charts are best suited for illustrating percentages, such as the top five sales by product or
country, or any other available categories.

The pie chart is a solid circle, whereas the donut chart has a center that is blank and allows
space for a label or icon.

When using pie charts, donut charts, and Treemaps, try to avoid presenting too many
categories because it results in thin slices (or rectangles) that provide no added value to the
user. If you do need to present all categories in your dataset, it's better to use another type of
visual, such as a column chart.

Pie charts and donut charts present data by dividing it into slices, while the Treemap
visualization displays data as a set of nested rectangles. Each level of the hierarchy is
represented by a colored rectangle (branch) containing smaller rectangles (leaves). The space
inside each rectangle is allocated based on the value that is being measured. The rectangles are
arranged in size from top left (largest) to bottom right (smallest).

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 89


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

A Treemap is ideal to visualize:

 Large amounts of hierarchical data when a bar chart can't effectively handle the large
number of values.
 Proportions between each part and the whole.
 The distribution pattern of the measure across each level of categories in the hierarchy.
 Attributes, by using size and color coding.
 Spot patterns, outliers, most-important contributors, and exceptions.

Combo charts

The combo chart visualization is a combination of a column chart and a line chart that can have
one or two Y axes. The combination of the two charts into one lets you:

 Compare multiple measures with different value ranges.


 Illustrate the correlation between two measures in one visual.
 Identify whether one measure meets the target that is defined by another measure.
 Conserve space on your report page.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 90


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Card visualization

The card visualization displays a single value: a single data point. This type of visualization is
ideal for visualizing important statistics that you want to track on your Power BI dashboard or
report, such as total value, YTD sales, or year-over-year change.

The multi-row card visualization displays one or more data points, with one data point for each
row.

Funnel visualization

The funnel visualization displays a linear process that has sequential connected stages, where
items flow sequentially from one stage to the next.

Funnel charts are most often seen in business or sales contexts. For example, they are useful
for representing a workflow, such as moving from a sales lead to a prospect, through to a
proposal and sale.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 91


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Funnel charts are great options in the following contexts:

 When the data is sequential and moves through at least four stages.
 When the number of items in the first stage is expected to be greater than the number
of items in the final stage.
 To calculate a potential outcome (revenue, sales, deals, and so on) by stages.
 To calculate and track conversion and retention rates.
 To reveal bottlenecks in a linear process.

Gauge chart

A radial gauge chart has a circular arc and displays a single value that measures progress toward
a goal or target.

The value at the end of the arc represents the defaulted maximum value, which will always be
double the actual value. To create a realistic visual, you should always specify each of the
values. You can accomplish this task by dropping the correct field that contains an amount into
the Target value, Minimum value, and Maximum value fields on the Visualization pane.

The shading in the arc represents the progress toward that target. The value inside the arc
represents the progress value. Power BI spreads all possible values evenly along the arc, from
the minimum (left-most value) to the maximum (right-most value).

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 92


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Radial gauges can be used to show the progress that is being made toward a goal or target, or
they can show the health of a single measure. However, radial gauges do take up a lot of space
in comparison to the insights that they provide. It is more effective to use a pair of gauges with
a spark line so users can see the trend and know what to do about it.

Waterfall visualization

The waterfall visualization (also known as a bridge chart) shows a running total as values are
added or subtracted, which is useful in displaying a series of positive and negative changes.
The chart consists of color-coded columns, so you can quickly identify increases and decreases.
The initial and the final value columns often start on the horizontal axis, while the intermediate
values are floating columns.

Waterfall charts can be used to:

 Visualize changes over time or across different categories.


 Audit the major changes that contribute to the total value.
 Plot your organization's annual profit by showing various sources of revenue to help
determine the total profit (or loss).
 Illustrate the beginning and ending headcount for your organization in a year.
 Visualize how much money you earn and spend each month and the running balance
for your account.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 93


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Scatter chart

The scatter chart visualization is effective when you are comparing large numbers of data
points without regard to time. The scatter chart has two value axes to show: one set of numerical
data along a horizontal axis and another set of numerical values along a vertical axis. The chart
displays points at the intersection of an X and Y numerical value, combining these values into
single data points. These data points might be distributed evenly or unevenly across the
horizontal axis, depending on the data. You can set the number of data points, up to a maximum
of 10,000.

You might want to use a scatter chart instead of a line chart because it allows you to change
the scale of the horizontal axis. Scatter charts also allow you to:

 Show relationships between two numerical values.


 Plot two groups of numbers as one series of x and y coordinates.
 Turn the horizontal axis into a logarithmic scale.
 Display worksheet data that includes pairs or grouped sets of values.
 Show patterns in large sets of data, for example, by showing linear or non-linear trends,
clusters, and outliers.
 Compare large numbers of data points without regard to time. The more data that you
include in a scatter chart, the better the comparisons that you can make.

The following example shows a scatter chart that displays outliers (anomalies) with a trendline
going up. The chart clearly shows that most products were sold at the same quantity, and only
some products were sold in larger quantities. By identifying those outliers, you can run further
analysis and break them down by country and region, which can help to improve logistics,
decrease costs, and increase customer satisfaction.

Maps

Power BI integrates with Bing Maps to provide default map coordinates (a process called
geocoding), so you can create maps. Together, they use algorithms to identify the correct
location; however, sometimes, it's a best guess.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 94


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

A basic map (bubble map) is used to associate categorical and quantitative information with
spatial locations. This type of map visual displays precise geographical locations of data points
on a map, as illustrated in the following image. A fill map uses shading, tinting, or patterns to
display how a value differs in proportion across a geographical region. Similarly, shape maps
use colors to display relative comparisons of geographical regions. You can also use an ArcGIS
map to display graphical information in a more interactive way.

Slicer visualization

The slicer visualization is a standalone chart that can be used to filter the other visuals on the
page. Slicers provide a more advanced and customized way of filtering, in comparison to the
Filters pane, which is suited to more basic filtering operations. You can learn more about these
two filtering options in another module.

Slicers come in many different formats, including list, drop-down, and buttons, and they can
be formatted to allow the selection of only one, many, or all available values.

Slicers are ideal to:

 Visualize commonly used or important filters on the report canvas for easier access.
 Simplify your ability to see the current filtered state without having to open a drop-
down list.
 Filter by columns that are unneeded and hidden in the data tables.
 Create more focused reports by putting slicers next to important visuals.

Tip

Using a slicer that is set to a drop-down format will defer the queries that are being sent to the
dataset and can help improve performance.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 95


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Q&A visualization

The Q&A visualization allows you to ask natural language questions and get answers in the
form of a visual. This ability to ask questions is valuable to consumers and to you, the report
author. This visualization type can help you create visuals in the report, and it can also be used
as a tool for consumers to get answers quickly.

The Q&A visualization consists of the following four core components:

 The question box, where users enter their question and are shown suggestions to help
them complete the question.
 A pre-populated list of suggested questions.
 An icon that users can select to convert the Q&A visual into a standard visual.
 An icon that users can select to open Q&A tooling, which allows designers to configure
the underlying natural language engine. When entering natural language queries with
Power BI Q&A, you can specify the visual type in your query. The following example
illustrates how to implement Net sales by country.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 96


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

4.4 Format and configure visualizations


Power BI Desktop gives you a variety of options for customizing how your selected
visualizations look, such as the colors and format of the text that they contain. You should take
time to explore the options to determine what impact they each have on a visual.

In this example, you will format and configure the default clustered column chart visualization
to better meet the needs of your report requirements.

Start by selecting the visualization on the canvas, and then select the Format button (paint
roller icon) to display the Format pane.

The formatting options that are available will depend on the type of visualization that you
selected.

Common formatting options include the Title, Background, and Border. In the Title section,
you can add a title to the visual, if it does not have one, or edit the title, if it has one already.
The aim of the title is to clearly describe what data is being presented in the visual. You can
format the title by changing the text, text size, font, color, background, and alignment. The
subsequent section shows an example of customizing a title.

In the Background section, you can set any color or image as the background for the visual. If
you plan to use an image as a background, try to select an image that won't have lines or shapes
that would make it difficult for the user to read the data. It is best to keep a white background
so the presented data can be clearly seen. The subsequent section shows an example of
customizing a background.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 97


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

In the Border section, you can set a border around the visual to isolate the visual from other
elements on the canvas, which helps make it easier for the user to read and understand the data.
You can change the border color and radius to be consistent with your color scheme.

If a General section is available, you'll be able to set the precise size and place for your visual
on your canvas. This option might be suitable if the drag-and-drop feature is not placing the
visual exactly where you want it to be. It can also be useful to ensure that you have aligned
specific visuals consistently.

You might also be able to format the colors and labels for specific data values. In the Data
colors section, you can set the colors that you want to use for the data values in the visual. You
can use different colors for different fields, but always try to be consistent when it comes to
selecting those colors. It is best to use the same color scheme throughout the report. In the Data
labels section, you can change fonts, size, and colors for all labels in the visual. Try to use solid
colors so the labels are clearly visible. For example, if the background is white, use a black or
dark grey color to display your labels.

The Tooltips section allows you to add a customized tooltip that appears when you hover over
the visual, based on report pages that you create in Power BI Desktop. Tooltips is a great feature
because it provides more contextual information and detail to data points on a visual. The
default tooltip displays the data point's value and category, but your custom tooltips can include
visuals, images, and any other collection of items that you create in the report page. The
subsequent section shows an example of customizing a tooltip.

As you make changes in the Format pane, notice that the visualization updates immediately to
reflect those changes. If you need to revert the changes that you make, select the Revert to
default option at the bottom of each section in the Format pane.

In the following examples, you will edit the title, change the background, and add a tooltip.

Title

You can edit a default title and add a title, if you don't have one. In this example, you will select
the column chart visualization and then, in the Format pane, scroll down and expand the Title
section. Edit the current title by changing it to Total Sales by Country, and then increase the
font size to 16 points.

4.5 Import a custom visual


In addition to the out-of-the-box visualizations in Power BI Desktop, hundreds of other
developers have created a multitude of visuals for you to choose from. If you have a specific
visual in mind, you can likely find it in the marketplace. If you can't find it, Power BI makes it
possible for you to build your own.

The custom visuals that are available in Microsoft AppSource are created by Microsoft and
Microsoft partners. Some of these custom visuals are certified and some are not. The certified
status means that the visual meets the Microsoft Power BI team code requirements; the visual
is tested to verify that it doesn't access external services or resources and that it follows secure

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 98


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

coding patterns and guidelines. The certification process is optional, so an uncertified visual is
not necessarily unsafe to use.

Note

Some organizations prefer not to use custom visuals for security or other reasons. Before you
import custom visuals, check with your organization to see whether custom visuals are allowed
or not. If they are not allowed, you can still create reports in Power BI Desktop with them, but
they will not render in Power BI service.

If you want to create your own custom visual, you can use the custom visual software
development kit (SDK), which is an open-source tool based on NodeJS (JavaScript
programming language) that is available on GitHub. The custom visual is packaged as a single
Power BI Visual Tools (.pbiviz) file that you can import into Power BI Desktop.

Creating a custom visual is beyond the scope of this unit, so in this example, you will import a
custom visual from AppSource.

In the Visualizations pane, select the Get more visuals icon and then select Get more visuals.
On the window that displays, locate and select the visual that you want to import and then
select Add.

The new visual will appear under the other visuals in the Visualizations pane. To add the visual
to your report, select its icon. You can then add fields to the visual and customize its formatting,
just like you would for any other visual.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 99


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Background

It is best practice to keep the default white background so the presented data can be clearly
seen. However, you can change the default background color to make a visualization more
colorful and easier to read or to match a particular color scheme. In this example, continue with
the column chart that is selected and then, in the Format pane, expand the Background section
and change the color to light grey.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 100


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Tooltip

Using tooltips is a clever way of providing more contextual information and detail to data
points on a visual. When you add a visual, the default tooltip displays the data point's value
and category, but you can customize this information to suit your needs. For example, you
might want to provide your report users with additional context and information, or specify
additional data points that you want users to see when they hover over the visual.

To expand on the data points that are displayed in the default tooltip, you can drag a field from
the Fields panel into the Tooltips bucket. However, you should not add many more fields to
the tooltips because adding too many fields can introduce performance issues and slow down
your visuals.

The following image shows the default tooltip first and then the customized tooltip that displays
additional data.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 101


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Another way to use tooltips is to display graphical information. The process of adding this type
of tooltip is not as straightforward, but it is worthwhile. You would begin by creating a new
page in the report.

Open the new page and then open the Format pane. Expand the Page Size section and then
select Tooltip from the Type list.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 102


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

In the Page information section, turn the Tooltip slider to On so that Power BI registers this
page as a tooltip page

Tooltips have limited canvas space, so to ensure that your visuals appear in the tooltip, on the
View tab, set the Page view option to Actual size.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 103


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Next, add one or more visuals to the tooltip page, in the same way that you would on any other
report page.

Now, you need to specify the fields for which you want the tooltip to display. Select the tooltip
page and then select the Values tab in the Visualizations pane. Drag the fields from the Fields
pane into the Tooltip bucket. In this example, you will drag the SalesAmount field into the
Tooltip bucket.

Return to the report page and apply the tooltip to one or more visuals on that page. Select a
visual and then, in the Format pane, scroll down to the Tooltip section. Turn the tooltip option
On and then select your tooltip page from the Page list.

When you hover over the visual, the tooltip will display.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 104


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

4.6 Add an R or Python visual


If you use the R or Python programming language, you can use them to visualize your data
within Power BI Desktop. Power BI Desktop has an out-of-the-box visualization option for
both R and Python that you can access on the Visualizations pane, and the process for creating
these visuals is almost the same. You can also import a custom R or Python visual from
Microsoft AppSource.

Note

If you decide to use an R or Python visual, and you want to refresh the data in Power BI service,
you'll need to use a personal gateway. For more information, see Use personal gateways in
Power BI.

Create an R visual

Before you create the R visual, you must install R on your local computer so that Power BI
Desktop can run R scripts. You can download and install R for free from many locations,
including the Microsoft R Application Network and the CRAN Repository.

When you have downloaded and installed R, Power BI enables it automatically, but you should
verify that it has been enabled in the correct location. In Power BI Desktop, select File >
Options and settings > Options and then select R scripting in the Global options list. Verify
that your local R installation is specified in the Detected R home directories drop-down menu
and that it properly reflects the local R installation that you want Power BI Desktop to use. In
the following image, the path to the local installation of R is C:\Program Files\R Open\R-3.5.3.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 105


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

When you've verified your R installation, you can create the R visual.

Select the R visual icon in the Visualizations pane and then select Enable on the window that
displays. You'll then see a placeholder R visual image on the report canvas, with the R script
editor underneath.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 106


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Next, in the Field panel, select the fields that you want to use in your script. They will display
in the Values section in the Visualizations pane. You'll use the data in these fields to create a
plot.

As you select or remove fields, supporting code in the R script editor is automatically
generated or removed. Based on your selections, the R script editor generates the following
binding code:

 The editor created a dataset dataframe with the fields that you added.
 The default aggregation is: do not summarize.
 Similar to table visuals, fields are grouped and duplicate rows appear only once.

When you have selected the fields, you're ready to write an R script that results in plotting to
the R default device. When the script is complete, select Run from the R script editor title
bar.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 107


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Power BI Desktop identifies the plot and presents it on the canvas.

Create a Python visual

No prerequisites exist for creating a Python visual, so you can start right away in Power BI
Desktop by selecting the Python visual icon in the Visualizations pane. Select Enable on the
window that displays, and then you'll then see a placeholder Python visual image on the report
canvas, with the Python script editor underneath.

You can continue creating a Python visual in the same way as you did when creating the R
visual. In summary, you would select the fields, write the Python script, and then select Run
from the Python script editor title bar.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 108


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Import an R or Python visual

To import an R or Python visual from AppSource, in the Visualizations pane, select the Get
more visuals icon and then select Get more visuals. On the window that displays, locate and
select the R or Python visual that you want to import and then select Add.

4.7 Work with key performance indicators


Key performance indicators (KPIs) are excellent in helping you track progress toward a
specific goal over time. To use a KPI, you need three pieces of information:

 A unit of measurement that you want to track, for instance total sales, number of
employee hires, number of loans serviced, or number of students enrolled.
 A goal for the measurement so that you can compare your progress with that goal.
 A time series, for instance daily, monthly, or yearly.

Start by adding the KPI visual to the design service. The following screenshot shows the KPI
icon in the Visualizations pane.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 109


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

When configuring the KPI visual, enter the unit of measurement that you are tracking in the
Indicator prompt. Then, enter the goal under Target goals and select the time series from
the Trend axis drop-down list, as shown in the following screenshot.

This action will produce a KPI that looks similar to the following screenshot.

KPIs work best in a series, for instance, showing the daily, monthly, and yearly goals in the
section of a Power BI report.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 110


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Exercise - Design a report in Power BI desktop


This unit includes a lab to complete.

Use the free resources provided in the lab to complete the exercises in this unit. You will not
be charged.

Microsoft provides this lab experience and related content for educational purposes. All
presented information is owned by Microsoft and intended solely for learning about the covered
products and services in this Microsoft Learn module.

Access your environment

Before you start this lab (unless you are continuing from a previous lab), select Launch lab
above.

You are automatically logged in to your lab environment as data-ai\student.

You can now begin your work on this lab.

Tip

To dock the lab environment so that it fills the window, select the PC icon at the top and then
select Fit Window to Machine.

The estimated time to complete the exercise is 45 minutes.

Note

A virtual machine containing the client tools you need is provided, along with the exercise
instructions. Use the button above to launch the virtual machine.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 111


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

A limited number of concurrent sessions are available - if the hosted environment is


unavailable, try again later.

This exercise uses the Power BI service. You'll need to use your organizational account
to login. If you don't have one or can't use yours, please create a free M365 Developer
account to complete the exercise.

Check your knowledge


Answer the following questions to see what you've learned.
1. What is the benefit of using a report tooltip?

To give users additional information about a report visual, such as the author and date/time it was created.

To provide additional detail that is specific to the context of the data that is being hovered over.

The benefit of using a report tooltip is it provides additional detail that is specific to the context
of the data that is being hovered over.

To give users the ability to export data from the visual.


2. Which of the following options isn't one of the four components in the Q&A visualization?

The question box, where users enter their question and are shown suggestions to help them complete their
question.

A pre-populated list of suggested questions

Automatic creation of a custom tooltip

Automatic creation of a custom tooltip isn't one of the four components in the Q&A
visualization.

An icon that users can select to convert the Q&A visual into a standard visual.

An icon that users can select to open Q&A tooling, which allows designers to configure the underlying
natural language engine.
3. Do you need to import custom visuals each time you want to use them when you're developing a new report,
not an existing report?

No, custom visuals are always available for selection under the Visualization pane.

yes, custom visuals must be imported from AppSource each time you start developing a new report.

Custom visuals must be imported each time you start developing a new report.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 112


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

No, custom visuals only need to be imported once and will always remain in Power BI for future use in a
new report.

4.7 Summary
If your organization wants to transform the way that it presents data to management and
stakeholders, and wants to move from a text and tabular report format to a more visual format,
you can use Power BI visuals. These visuals help report users get quicker, easier access to the
information that they need to make their business decisions, from a report that is more visually
pleasing.

To help your report audience connect and interact with these visuals, you can create a
combination of visuals in your Power BI Desktop and then customize those visuals to ensure
that they comply with organizational requirements.

Power BI Desktop offers a range of visual options that you can quickly add to your report, and
it also gives you the ability to import custom visuals from a rich library that you can use to
solve additional business problems. You can select the most effective visuals for your report
needs and take advantage of Power BI's formatting options to customize those visuals to meet
your organization's requirements.

If Power BI Desktop didn't provide visuals as the means to effectively communicate the
insights that you find in your data, your user might find it difficult to access the information
that they need and might ultimately struggle to make good business decisions.

Now that you have added visuals to your report, your managers can access the underlying data.
The added bonus of a cleverly-designed report in Power BI that contains a variety of visuals is
that your managers and all other report users will enjoy the experience of using your report.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 113


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Unit 5:

Data analysis in Power BI

5.1 Introduction to analytics


Analytics encompasses emerging industry practices, such as data mining, big data analytics,
machine learning, AI, and predictive analytics. It is a term that is used to describe the technical
aspects of analytics that have predictive capabilities and can be used to solve business
problems.

https://www.microsoft.com/en-us/videoplayer/embed/RWFJCL?postJsllMsg=true

Analytics can transform raw data into an extensive collection of information that categorizes
data to identify and analyse behavioural data and patterns. Organizations can use this
information to analyze the current state of their operations and to predict future behaviour and
trends by asking "what-if" questions. Additionally, analytics can help with fraud detection,
image recognition, sentiment analysis, overall general employee productivity, and it also often
replaces cumbersome manual processes.

Consider the scenario where you ask an employee to determine the cause of a recent spike in
sales. The employee might have to painstakingly inspect each sale, interview customers, talk
to sales people, and examine market trends. Instead, you can use the Microsoft Power BI key
influencers visual to use advanced analytics and possibly get an answer much faster. The visual
is only as good as the data that you give it, so you'll still have to collect the data and organize
it. The actual analytics, however, can be done for you or at least give you an excellent start.

By reducing manual work, advanced analytics is ultimately able to help organizations make
better business decisions and create actionable and meaningful results.

Traditionally, data analysis was a complex task that was carried out by engineers. Today, data
analysis is more accessible to, and understood by, many people within organizations, across all
teams. Power BI is an exceptional tool for quickly pulling actionable insights from data. It
allows you to build visuals and metrics for your data in reports and dashboards so that you and
your users can analyze data insights at a high level and drill down into those insights for more
detailed information.

In this module's scenario, you work for Tailwind Traders as a data analyst. You've been tasked
with building reports and dashboards that will be used across the organization to help with
crucial business decisions. For example, the Product team is interested in learning if specific
products are not selling as well as others, the Sales team is focused on sales forecasts for the
coming year, and the Warehouse team is interested in a general breakdown of how the
warehousing and shipping locations are performing worldwide. For each of these teams, you
have to build and share unique reports and dashboards that display high-level insights and
visuals that are developed by using advanced analytics.

The inherent functionality of Power BI will help you accomplish this task. You can develop
quick insights and share them in reports and dashboards with different teams within the

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 114


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

organization. The advanced analytics capabilities of Power BI will enable you to identify
categories and trends, see how data changes over time, and much more. From this information,
you can make predictive data models and, therefore, help your organization make more robust
business decisions, plans, and forecasts.

This module outlines the advanced analytic capabilities of Power BI. By the end of this module,
you will be able to:

 Explore statistical summary.


 Identify outliers with Power BI visuals.
 Group and bin data for analysis.
 Apply clustering techniques.
 Conduct time series analysis.
 Use the Analyse feature.
 Use advanced analytics custom visuals.
 Review Quick insights.
 Apply AI Insights.

5.2 Explore statistical summary


Data is often intertwined with statistics because statistics are one way in which you can explore
your data. Statistics show you the distribution of your data and help you to identify key
takeaways and trends and determine whether outliers exist.

The statistical summary is the information that provides a quick and simple description of your
data. Power BI has many functions that help you to conduct a statistical analysis, such as Data
Analysis Expressions (DAX) functions, visuals such as histograms and bell curves, advanced
analytics visuals, and statistical programming languages such as Python and R.

Exploring the statistical summary gives the user a high-level view of the available data, where
they can see clusters, patterns on behavioral data, data averages, and more. They can gain
insights about their data that will help drive business decisions.

For example, the Supply Chain team asks you to create a report that shows the frequency of
orders for certain products and what the top 10 products are in terms of sales.

Statistical functions

Power BI Desktop has a number of DAX functions that you can use to get quick statistics based
on your data. You can access these quick functions by right-clicking the Values field in the
Visualizations pane, as illustrated in the following image.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 115


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

However, to avoid performance issues, it's better to create the statistical measures yourself by
using DAX functions to calculate average, sum, min, max, and so on. For example, to analyze
the inventory data to find the average order quantity for each product, you could use the
following formula:

DAX
Average Qty =
AVERAGE ( Sales[Order Qty] )

Histogram

Histograms and bell curves are the most common way to display statistics about your datasets.
In Power BI terms, you can represent a histogram with one of the bar or column chart visuals
and represent a bell curve with an area chart visual, as illustrated in the following image. You
can also use the Q&A visual to ask a direct question about the top or bottom items in a list.

A typical bar or column chart visual in Power BI relates two data points: a measure and a
dimension. A histogram differs slightly from a standard bar chart in that it only visualizes a
single data point.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 116


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

In this example, you use the clustered column chart visual to present a histogram that
determines the order quantities by order sizes.

You start by selecting the clustered column chart icon on the Visualization pane. Next, create
a new grouping for the x-axis. You will learn more about grouping and binning later in this
module, but they are useful in this context also.

To create the group, in the Fields pane, right-click the data field that you want to analyze and
then select New Group. In this case, you use the OrderQty field. In the Groups window that
displays, set up the bin group as follows:

1. Rename the group as Order Bins (Buckets).


2. Set the Group type option to Bin and the Bin Type option to Number of bins.
3. Enter 5 as the Bin count, 1 as the Min value, and 44 as the Max value.

Next, populate the visual as follows:

1. Drag and drop the OrderQty field from the Fields pane into the Value field on the
Visualizations pane.
2. Drag and drop the Order Bins (Buckets) group from the Fields pane into the Axis
field on the Visualizations pane.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 117


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The visual now shows that the data is grouped into buckets on the x-axis, with the order
quantities of that variable on the y-axis.

You have now produced a histogram that displays the order quantity (OrderQty field) by
order size buckets for the Supply Chain team.

Top N analysis

The TOPN DAX function returns the top N rows of a specified table. The Top N analysis is a
great way to present data that might be important, such as the top 10 selling products, top 10
performers in an organization, or top 10 customers. Alternatively, you can look at it from the
other perspective and present the bottom 10 items in a list, in other words, the worst
performers. Depending on the requirements, you might want to use one or both of these
options.

In this example, the Supply Chain team wants to know what the top 10 selling products are.
You accomplish this task in one of three ways: by using a Q&A visual, using a Top N filter,
or writing a DAX formula.

Use the Q&A visual to find the top N

You've created a report for the Supply Chain team, and now the team members have
questions about various other views or insights that they are interested in. Power BI has a
built-in Q&A visual that allows users to ask their own questions and get answers so you don't
have to address each individual question. The Q&A visual is an effective tool because it
allows users to quickly get answers about the data independently, which saves time for
everyone involved. The Q&A visual is unique in that it does not require knowledge of Power
BI to use the visual; users can ask their question and they, too, can create insightful visuals.

Add the Q&A visualization to your report, and then reposition the visual and customize its
formatting, as required.

Now, you can use the visual to get answers. In this case, you want to know what the top 10
selling products are, so you enter a question such as, "What are my top 10 products by sales?"
Power BI will automatically display those results for you.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 118


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Use a Top N filter type

Top N is a filtering option that is available on the Filters pane. Select the field that you want
to analyze on your report page (in this example, it's the Product Name field). In the Filters
pane, expand the Filter type list and select Top N. In the Show items settings, select Top
and 10. Then, select Cost of Sales as the value that you want to filter the field by. The visual
updates accordingly.

Use a TOPN DAX function

You can also calculate your top 10 products in DAX by using the TOPN function. This
option could be useful if you want to present the top 10 in a different context, such as how
much of the top 10 best-selling products contributed toward the overall total sales.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 119


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Start by creating a new measure called Top 10 Products. Then, use the TOPN function,
along with the SUMX function, to calculate your top 10 products by total sales, as follows:

DAX
Top 10 Products =
SUMX ( TOPN ( 10, Product, Product[Total Sales]), [Total Sales] )

The following image shows the top 10 products versus total sales for comparison.

You can adjust the DAX formula to present the same result in percentages.

5.3 Identify outliers with Power BI visuals


An outlier is a type of anomaly in your data, something that you didn't expect or that surprised
you, based on historical averages or results. You will want to identify outliers to isolate data
points that significantly differ from other data points, and then take action to investigate the
reasons for the differences. The results of this analysis can make a significant impact on
business decision making.

Consider the scenario where you are analyzing data for a shipping warehouse. You notice that
the number of orders increased above average for a specific product category. You first want
to identify the product category. Then, you want to ask several questions about the outlier:

 Did above average shipments happen that day?


 Did this anomaly occur in a specific warehouse?
 Did a single event cause the increase in orders for that specific category?
 Did this event occur on other days in the last month, quarter, year, or prior year?

Power BI allows you to identify outliers in your data, but you need to first determine the logic
behind what constitutes an outlier. You can use trigger points, such as calculations, around
what you would consider the outlier to be.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 120


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The process of identifying outliers involves segmenting your data into two groups: one group
is the outlier data and the other group is not. You could use calculated columns to identify
outliers, but the results would be static until you refresh the data. A better way to identify
outliers is to use a visualization or DAX formula because these methods will ensure that your
results are dynamic.

When you have identified the outliers in your data, you can then use slicers or filters to highlight
those outliers. Additionally, you can add a legend to your visuals so that the outliers can be
identified among the other data. You can then drill in to the outlier data for more detailed
analysis.

Use a visual to identify outliers

The best visual to use for identifying outliers is the scatter chart, which shows the relationship
between two numerical values. Scatter charts display patterns in large sets of data and are,
therefore, ideal for displaying outliers.

When you add a scatter chart to your Power BI report, you put your fields of interest in the X
Axis and Y Axis sections, respectively. In this case, the Orders Shipped field is on the x-axis,
and the Qty Orders field is on the y-axis.

The visual will update to display the data according to the selected fields, and you'll be able to
clearly identify the outliers in that data; they are the isolated items that are away from the bulk
of the data.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 121


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Now that you can identify the outliers in your data, you can investigate the reasons for their
existence and take corrective action.

Use DAX to identify outliers

You can use DAX to create a measure that will identify the outliers in your data, such as in the
following formula:

DAX
Outliers =
CALCULATE (
[Order Qty],
FILTER (
VALUES ( Product[Product Name] ),
COUNTROWS ( FILTER ( Sales, [Order Qty] >= [Min Qty] ) ) > 0
)
)

Order Qty is a measure in the Sales table, and Min Qty refers to the lowest order quantity in
the Sales table

When you have created a new outlier measure, you can group your products into categories by
using the grouping feature, as you previously did when creating a histogram. You then need to
add a scatter chart visual, as you did in the previous section, because this is the best
visualization option for displaying outliers. When you've added the scatter chart, populate it
with the fields that are associated with your DAX formula and outlier measure.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 122


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

In the scatter chart, you'll be able to identify the outliers in your data. You can then investigate
the reasons for their existence and take corrective action.

5.4 Group and bin data for analysis


When you create visuals, Power BI Desktop aggregates your data into groups, based on the
values that it finds in the underlying data. You can refine how those default groups are
presented. You can also create new groups by grouping two or more data points in a visual or
putting values into equal-sized groups (binning).

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 123


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Grouping is used for categories of data. Binning is similar to grouping, but it is used for
grouping continuous fields, such as numbers and dates.

You can use the grouping and binning features to ensure that the visuals in your reports display
your data according to your preference. Using these features will help you to clearly view,
analyze, and explore the data and trends in your visuals. Additionally, you'll be able to identify
clusters, patterns of behavior, data averages, and more. The results of this analysis will provide
your users with more specific insights on their data, which can help drive business decisions.

In this example, the Customer Service team has returned to you, greatly impressed by the
analysis that you have done. Now, they want you to further analyze their Help ticket data,
asking if you can segment the data into different groups and clusters. In particular, they want
to identify the cities with the highest sales.

Create a group

The following image shows a bar chart in which Power BI has automatically segmented the
data in the way that it found most useful: Total Sales by State. However, you want to group
some of the bars (states) together so that you can view them as one category, which will help
the Sales team identify the cities with the highest sales.

To create the group, use Ctrl + click to select the data points on the visual that you want to
group. In this case, it's states with sales greater than 500,000 dollars. Right-click one of those
selected data points and then select the Group data option.

When the group is created, notice that the visual updates to take into account the new group.
The following image shows that the other states, which are the states with lower sales (less
than 500,000 dollars) have been grouped together and are highlighted in a different shade.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 124


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The new group field displays in the Legend bucket for the visual and is listed in the Fields
pane.

When you create a group, you can change the way that the data is displayed in the visual. For
example, you might want to switch the values in each axis. You can also use the group in any
of the other visuals in your report. To do so, drag the group field from the Fields pane and then
drop it into the visual in which you want to use it.

Edit a group

Continuing with the previous example, you now want to edit the categories that make up your
group. Right-click the group field in either the Legend bucket or the Fields pane, and then
select Edit Groups.

In the Groups window that displays is a list of the groups and the different items within those
groups. The following image shows the States with Sales > 500k group and its members, along
with the Other group (States with Sales < 500k) that contains all other values that have not
been put into the first group. If you refresh your data, and new items appear in the ungrouped
values list, they'll all go into the Other group.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 125


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You can now make changes to the group. You can rename any group by double-clicking the
group title in the Groups and members section and entering a new name. You can add
ungrouped values into an existing group, remove values from an existing group, and create a
new group.

Create bin groups

The process of binning allows you to group your numerical and time field data into "bins" of
equal size. This approach allows you to visualize and identify trends in your data in more
meaningful ways. Binning allows you to right-size the data that Power BI Desktop displays.

In this example, you want to create bins (groups) for the Order Qty field. Start in the Fields
pane by right-clicking the Order Qty field that you want to create the bins for, and then select
New Group. On the Groups window that displays, set the Bin size to the size that you want,
adjust other settings as required, and then select OK.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 126


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

When you have set up the bin group, you'll see a new field in the Fields pane with (bins)
appended to its name. You can then drag that field onto the canvas to use the bin size in a
visual.

5.5 Apply clustering techniques


Clustering allows you to identify a segment (cluster) of data that is similar to each other but
dissimilar to the rest of the data. The process of clustering is different to that of grouping, which
you accomplished previously.

The Power BI clustering feature allows you to quickly find groups of similar data points in a
subset of your data. It analyzes your dataset to identify similarities and dissimilarities in the
attribute values, and then it separates the data that has similarities into a subset of the data.
These subsets of data are referred to as clusters.

For example, you might want to look for patterns in your sales data, such as the behavior of
customers overall. You can segment the customers into clusters according to their similarities,
such as age or location.

Start by adding the scatter chart visualization to your report and then add the required fields to
the visual. In this example, you will add the Order Qty field to the x-axis, the Sales field to
the y-axis and Unit Price to the Values field. The following image shows considerable data in
the scatter chart, so it is difficult to discern any natural groups.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 127


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

To apply clustering to your scatter chart, select More options (...) in the upper-right corner of
the visual and then select Automatically find clusters.

On the Clusters window that displays, you can edit the default name, field, and description, if
required. However, for this example, you want to change the number of clusters. The following
image shows that the Number of clusters box is blank by default, which means that Power BI
automatically finds the number of clusters that it determines as making the most sense with
your data.

Enter the number of clusters that you want (3) into the box and then select OK. Power BI will
run the clustering algorithm and create a new categorical field with the different cluster groups
in it. Now, when you look at the visual, you can clearly see the clusters that are in your data
and proceed to perform analysis on them.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 128


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The new cluster field is added to your scatter chart's Legend field well bucket, which you can
now use as a source of cross-highlighting like any other Legend field. You can also find the
new cluster field in your field list and use it in new visuals, just like any other field.

If you want to edit the cluster, right-click the cluster field and select Edit clusters.

In the preceding example, when you applied clustering to the scatter chart, you could only use
two measures. If you want to find clusters by using more than two measures, you can use a
table visual instead, add all the fields you want to use, and then run the clustering algorithm by
using the same process.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 129


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

5.6 Conduct time series analysis


In 2004, Hans Rosling presented a Ted Talk titled, "The best stats you've ever seen." In that
talk, Hans showed a video that allowed him to analyze data over time by playing an animated
chart. The chart progressed, year-by-year, where viewers could watch how the longevity and
family size moved over time for the entire world. This presentation initiated tremendous
interest in the power of data visualization, particularly as it related to time series analysis.

Time series analysis involves analyzing a series of data in time order to identify meaningful
information and trends and make predictions. The result of time series analysis is the best data
that you can use for forecasting activities.

Time series analysis often involves the use of visuals such as Gantt charts, project planning,
and stock movement datasets. In Power BI, you can use visuals to view how your data is
progressing over time, which in turn allows you to make observations, such as if any major
events disrupted your data.

To conduct a time series analysis in Power BI, you need to use a visualization type that is
suitable for displaying trends and changes over time, such as a line chart, area chart, or scatter
chart. You can also import a time series custom visual into Power BI Desktop from Microsoft
AppSource. The following example uses a standard scatter chart.

In addition to the range of time series custom visuals, Microsoft AppSource has an animation
custom visual called Play Axis that works like a dynamic slicer and is a compelling way to
display time trends and patterns in your data without user interaction. This visual is similar to
the one that Hans Rosling used in his original presentation and is used alongside the scatter
chart in the following example.

Note

Some organizations prefer not to use custom visuals for security or other reasons. Before you
import custom visuals, check with your organization to see if they are allowed or not. If they
are not allowed, you can instead use the Play Axis visual that is available for scatter chart
visualizations within Power BI Desktop because it has similar functionality.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 130


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

In this example, you are developing a Sales report. The Sales team wants to study the quarterly
sales trends and identify which models sell better, depending on the time of the season. You
decide to use two visuals, a scatter chart and line chart, for the purpose of time series analysis,
and then enhance those visuals with animation so the Sales team can see how the sales data
changes over time.

You start by adding your visuals to the report page to show the sales data.

Next, you will import the animation custom visual to use with the visuals. In the Visualizations
pane, select the Get more visuals icon and then select Get more visuals. On the Power BI
Visuals window that displays, search for play axis, and then select the Add button for the Play
Axis (Dynamic Slicer) visual.

A message will display, stating that the visual was successfully imported. When you return to
Power BI Desktop, you'll see the new Play Axis icon in the Visualizations pane. Select the
page, and then select the Play Axis icon to add that visual to the page.

With the new visual selected, select the field (Quarter) that you want to use as the slicer in the
Play Axis animation. Animation controls become available on the visual.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 131


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You can now resize and reposition the new visual and customize its formatting so that it's
consistent with the other visuals on the page. Specific formatting options that you might want
to use include:

 In the Animation Settings section, you can control the play functionality of the Play
Axis visual, such as making the animation automatically start, continue looping, and
then change the speed at which the animation occurs.
 In the Colors section, you can change the appearance of the Play Axis visual by
adjusting its overall color, or selecting the Show all option, and then changing the color
of each control button.
 The Enable Caption On section allows you to turn on/off the text that is displayed
next to the visual or adjust the formatting of it.

When you have set up the Play Axis visual to meet your requirements, you are ready to use it
with your other visuals. Select the Play button and then watch how the data in each visual on
the page evolves over the time. You can use the control buttons to pause the animation, restart
it, and so on.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 132


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

5.7 Use the Analyze feature


The Analyze feature provides you with additional analysis that is generated by Power BI for a
selected data point. You might want to use this feature to determine if Power BI has found
something that you haven't seen before, or if you want Power BI to give you a different insight
into your data. This feature is particularly useful for analyzing why your data distribution looks
the way that it does.

Note

This feature does not work if you have non-numeric filters applied to your visual and/or if you
have measure filters applied.

In this example, you are developing a report for the Customer Service team that deals with
Help tickets. They want to analyze the ticketing data that is created online when a customer
asks a question. You've created a preliminary visual to display data for tickets by location, but
you're now curious about why the distribution of your data looks the way that it does.

Instead of exploring the data manually, you can use the Analyze feature to get fast, automated,
insightful analysis of your data.

To use the Analyze feature, right-click a data point on the visual and then hover over the
Analyze option to display two further options: Explain the increase and Find where the
distribution is different. The options that are available will depend on the data point that you
selected.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 133


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

In the example below, you select the Explain the increase option, and a window displays with
a new visual, as illustrated in the following image.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 134


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

If you find this analysis useful, you can add the new visual to your report so that other users
can view it. Select the plus (+) icon in the upper-right corner of the visual to add it to your
report.

5.8 Use advanced analytics custom visuals


Completed 100 XP

 5 minutes

In addition to the out-of-the-box visualizations that you see in Power BI Desktop, Microsoft
AppSource has a vast library of custom visuals that you can import into Power BI Desktop.
These custom visuals give you a wider choice of options when it comes to using advanced
analytics. A custom visual might exist that solves a business problem that the standard visuals
can't solve, or you might find one that presents your data in a way that the standard visuals
can't.

Note

Some organizations prefer not to use custom visuals, or only permit certain custom visuals, for
security or other reasons. Before you import custom visuals, check with your organization to
see whether they are allowed or not. If they are not allowed, you can still create reports in
Power BI Desktop with them, but they will not render in Power BI service.

Previously, you imported a custom visual from Microsoft AppSource for the purposes of time
series analysis. For this example, you'll focus on the range of Advanced Analytics custom
visuals that are available. These custom visuals include box-and-whisker plots, variance charts,
hierarchical trees, Gantt plots, clustering plots, and much more. Using advanced analytics
visuals adds a layer of complexity to your reports and allows you to further analyze the data
and develop granularity within your visuals.

In this example, you've produced some charts and visuals for the Customer Service team, but
now they want you to create a variance chart so they can study the variance in the Help tickets.
You decide to browse Microsoft AppSource to see if an advanced analytics visual exists that
you can use to satisfy this request.

In the Visualizations pane, select the Get more visuals icon and then select Get more visuals.
On the Power BI Visuals window that displays, select the Advanced Analytics category.
Browse the available options and then select the Add button for the visual that you want to
import. In this example, you will add the Variance Chart custom visual.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 135


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

When the visual has been imported, an icon for the new custom visual displays under the other
visual icons in the Visualizations pane.

You can then add fields to the new visual and customize it in the same way that you would for
any other visual. In this example, you will add Country to the Category field, Gross Sales to
the Primary Value field, and Net Sales to the Comparison Value field.

Then, you should notice that you have a variance visual that contains multiple charts, which is
a task that you couldn't complete without importing the Advanced Analytics custom visual
from AppSource.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 136


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

5.8 Review Quick insights


The Quick insights feature in Power BI uses machine learning algorithms to go over your
entire dataset and produce insights (results) for you quickly. This feature is a great way to build
dashboards when you don't know where to start. It also helps you find insights you might have
missed when building your reports. From the insights that Power BI discovers, you can
generate appealing, interactive visualizations.

Note

This feature is available in the Power BI web service only. Also, this feature doesn't work with
DirectQuery; it only works with data that is imported to Power BI.

Consider the scenario where one of the datasets that you've been given contains substantial
data concerning the Help tickets that were created for the Customer Service team. Because of
the extensive data, you don't know where to begin analyzing, so you decide to let Power BI do
it for you.

Get quick insights on your dataset

To get quick insights on your dataset, open your Power BI web service and then select the
Content tab. Locate your report for which you want to get quick insights, which in this case is
TailwindTraders. Then, select More options (...) > Quick insights.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 137


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Power BI will use various algorithms to search for trends in your dataset. This process might
take a few seconds, but when it is finished, you'll see a message in the upper-right corner letting
you know that the results are ready to be viewed.

Select View insights to open the Quick Insights page for the selected dataset, and then view
the insights that Power BI has found for you. The Quick Insights page contains up to 32
separate insight cards, and each card has a chart or graph plus a short description. In this
example, one of the insights is a card that displays a visual for Count of Product by Category
Name, as illustrated in the following image.

Add a Quick insights result card to a dashboard

If you see an insight card that is particularly compelling, you can add it to your dashboard. On
the Quick Insights page, hover over the card, then select the pin icon. The visual is added to
your dashboard, where you can reposition it as required.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 138


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Interact with the quick insights results

To take a closer look at a particular insight card on the Quick Insights page, select an insight
card to open. The insight screen opens in Focus mode.

You can then perform the following actions:

 Filter the visualization by using the available options in the Filters panel.
 Pin the insight card to a dashboard by selecting Pin visual.
 Run insights on the card (scoped insights) by selecting Get insights in the upper-right
corner. The scoped insights allow you to drill into your data.
 Return to the original insights canvas by selecting Exit Focus mode in the upper-left
corner.

5.9 Apply AI Insights


The AI Insights feature allows you to connect to a collection of pretrained machine learning
models that you can apply to your data to enhance your data preparation efforts.

Continuing with the previous example, you now want to add text analytics to the content of the
Comments field in the ticketing data. This process will help you see if you can determine the
sentiment of the customers that are featured in the Help tickets. You can use the AI Insights
feature to accomplish that task.

To apply the AI Insights feature to your data, open Power Query Editor and select the Add
Column tab. Three AI Insights options will be available for you to choose from: Text
Analytics, Vision, and Azure Machine Learning.

Note: Premium capacity is required to use the Text Analytics and Vision options.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 139


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Note

If you do not see these options, you need to enable the AI Insights feature in Power BI Desktop
settings. Go to File > Options and settings > Options. In the Global options list, select
Preview features, select the check box for the AI Insights function browser option, and then
select OK.

On the Add column tab, the most relevant AI Insights option for this example is Text
Analytics. This option includes Azure Cognitive Services models, such as Sentiment Analysis,
Key Phrase Extraction, and Language Detection, that derive meaning or specific pieces of
language from text data. You can use either the Sentiment Analysis or Key Phrase Extraction
option to determine the customer sentiments in the Help tickets and visually show the results
in Power BI.

Check your knowledge


Answer the following questions to see what you've learned.
1. What Power BI feature can give an in-depth analysis of the distribution of data?

The Next Level of Hierarchy feature can give in-depth analysis because it will allow you to drill down for
all subcategories and is not used to analyze the distribution.

The Analyze feature allows a user to understand why the distribution looks the way that it does.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 140


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The Analze feature gives an in-depth analysis of the distribution of data.

Only time series analysis can provide in-depth analysis on the data.
2. Where are time series charts located?

The filter pane is where all filters on visuals and pages are located.

Time series charts can be imported from AppSource.

Time series charts can be imported from AppSource.

The fields pane is where all charts are located.


3. What visual should be used to display outliers?

The line chart is best-suited to display outliers.

The scatter chart is best-suited to display outliers.

The scatter chart displays outliers.

The clustered column chart is best-suited to display outliers.

5.10 Summary
In this module, you learned about the emerging power of advanced analytics and discovered
how the advanced analytics capabilities of Power BI can bring value to your organization's
decision making and strategy formulation.

You enhanced the reports and dashboard that you previously created to enable users across
your organization to ask more questions and find more information that is specific to their
teams and work contexts. You used Power BI to explore your data and create a statistical
summary to find key takeaways and trends and identify outliers that might require immediate
action. You conducted a time series analysis of your data to see how your data progressed over
time so that you could make observations and forecast behavior. Additionally, you used the
Analyze feature to get Power BI to explain the increases and show you where the distribution
was different in your data. You built upon the standard visuals in your report by adding custom
visuals that helped you solve additional business problems and display data in more enhanced,
animated ways. Then, you returned to Power BI to check for quick insights in your data that
you had not already discovered and to find more useful insights that you could add to your
dashboards. Lastly, you used the grouping, binning, and clustering techniques to segment and
present your data in different ways.

The advanced analytical techniques that you applied to your organization's data enabled you to
gain new insights in that data, and further scrutinize the data to uncover patterns, trends, and
outliers that you did not know existed. The results of your advanced analysis will empower
your organization to make more robust business decisions, plans, and forecasts

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 141


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Unit 6. :
Manage workspaces and datasets in Power BI

6.1 Introduction
You've likely had the chance to load and transform data from numerous sources, build visuals,
create DAX equations, and even publish a report or two to Microsoft Power BI. The next step
on your data analysis journey is to share these reports with your wider audiences and
organizations. You can accomplish this task in a workspace, which is a feature of Power BI. A
workspace is a centralized repository in which you can collaborate with colleagues and teams
to create collections of reports and dashboards.

https://www.microsoft.com/en-us/videoplayer/embed/RWFJCN?postJsllMsg=true

Workspaces offer the following benefits:

 Focused collaboration efforts. You can use workspaces to house reports and dashboards
for use by multiple teams.
 Ability to share and present reports and dashboards in a single environment.
 Assurance that the highest level of security is maintained by controlling who can access
datasets, reports, and dashboards.

This module will discuss several tasks that are focused on helping you to create and manage a
workspace in Power BI. Additionally, you will learn about importing and updating assets in a
workspace, configuring data protection, troubleshooting data, and much more.

6.2 Distribute a report or dashboard


Consider a scenario where you have created a few reports for the Sales team at Tailwind
Traders. The issue that you have encountered is determining how to make these reports
viewable and shareable. By creating a workspace in Power BI, you can house your reports in
one location, make them shareable, collaborate with other teams, and update reports.

Create a workspace

Your first task is to create a workspace by following these steps:

1. Go to Power BI service.
2. Select the Workspaces drop-down menu.
3. Select the Create a workspace button at the bottom of the resulting panel.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 142


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

4. In the Create a workspace window, enter information in the Workspace name and Description fields
and then upload a Workspace image.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 143


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

5. In the Advanced drop-down menu, you can create a Contact list of users who will receive notifications
if issues with the workspace occur.

By default, these users are the workspace admins, but you can also add specific users. You can
also add this workspace to a specific OneDrive and then choose whether this workspace will
be a part of a dedicated capacity or not. Dedicated capacities are Power BI Premium features
that ensure that your workspace will have its own computational resources as opposed to
sharing resources with other users.

6. After you have filled out pertinent fields on the Create a workspace window, select Save.

You have now created a workspace.

You can complete the process of creating a workspace by using the new workspace experience.
We recommend that you use the modern workspace experience over the classic workspace
experience, unless the classic workspace is expressly needed.

Assign workspace roles

Now that you've successfully created a workspace, the Sales team wants to collaborate with
other teams to build additional dashboards and reports. As the workspace owner, you want to
ensure that appropriate access is given to members of the Products team because their team
includes stakeholders and developers. Workspace roles allow you to designate who can do what
within a workspace.

The abilities of role types in a workspace include:

 Admin
o Add/remove other users
o Publish, update, and/or share an app in a workspace
o Create, edit, delete, and publish reports and content in a workspace
o View and interact with reports and dashboards in a workspace
o Configure data refreshes
 Member
o Can add users with lower permissions
o Cannot remove users
o Cannot delete the workspace
o Cannot update the metadata about the workspace
 Contributor
o Cannot add or remove users
o Cannot publish, update, or edit an app in a workspace unless given this ability
by admins/members
o Can create, update, and publish content and reports within a workspace
o Can schedule data refreshes
 Viewer
o Cannot add or remove users
o Can only view a report or dashboard in a workspace
o Can read data that is stored in workspace dataflows

Note

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 144


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

If the workspace is backed by a Premium capacity, a non-Pro user can view content within the
workspace under the Viewer role.

To assign these roles to users, go to the workspace that you've created and, in the upper-left
corner of the ribbon, select Access.

In the resulting Access window, you can add email addresses of individual users, mail-enabled
security groups, distribution lists, Microsoft 365 groups, and regular security groups, and then
assign them to their specific roles. You can also change the user's assigned role at the bottom
of the page and delete the user from the workspace by selecting the ellipsis (...) next to their
name.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 145


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Create and configure an app

After creating an app workspace and assigning your collaborator-specific roles, you want to
add content to your app workspace. Content can be in the form of reports, dashboards, datasets,
dataflows, and so on. An app is a published, read-only window into your data for mass
distribution and viewing. When ready to share apps with your users, you can publish the app.
This process requires a Power BI Pro license. Consuming and viewing an app requires a Pro
license or it must be backed by a Premium capacity.

When you have added your content to the app workspace, you can create the app. Go to your
workspace, and on the ribbon, select + New, as shown in the following screenshot. In this
ribbon, you can choose to create a new report, dataset, streaming dataset, or dataflow, to name
a few. Selecting any one of these options will generate a window where you can enter the name
of the app and select the source of the report (for example, the dataset that is used to create a
report).

You can also select the Get Data button in the lower-left corner of the navigation bar, and then
import already-existing reports from Power BI Desktop and add them to your workspace app.

You can also configure your app and turn on the option to include the report or dashboard in
the app when you publish, as shown in the following screenshot. If you do not want to include
this report or dashboard in the app, then you can turn off this option.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 146


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

When you are ready to publish your app with its collection of reports, dashboards, and datasets,
return to the workspace and select Create app in the upper-right corner of the ribbon.

This action retrieves the following window, where you can build your app by naming it, adding
a description, and adding an app logo or theme color, if necessary.

Under the Navigation tab, you can change the order in which the content is oriented for the
user by creating a custom navigation pane. For instance, you can change the name of the
content, change the link, and then add it to a specific section on the navigation pane. You can
also add content that is external to Power BI through a link. This external content can also be
included within the content area. For example, a YouTube video or PowerPoint slide deck has
to be an embed URL, not the raw URL

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 147


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Under the Permissions tab, you can grant access to all users in your organization or choose
which users have access. You can also give your users build and share permissions, which
means that they can create and share the content in the app. The Permissions tab provides a
few other options. With Build permissions, you can allow your users to connect to underlying
datasets so that they can reuse and build their own reports by using the same dataset. Build
permissions are required if your users want to export the underlying data or build new content
on top of the data. You can also allow your users to only create a copy of the report to view in
another workspace, where they can modify and delete visuals according to their needs. You
can also give your users Share permissions so that they can share underlying datasets and
reports.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 148


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

After making necessary edits, you can select Publish app, and your app will be published.
Then, you will get the following screen with a link that you can share with your users.

Update workspaces

After publishing your app, you realize that you want to make updates within your workspace.

To accomplish this task, return to the workspace, and make the necessary updates in the
reports or dashboards. The workspace acts as a staging area where you can make any changes
that you want, but they will not be added to the app until you select Update app in the upper-
right corner of the ribbon (where you previously selected Publish app). Dataset and dataflow
updates are updated immediately. When you decide to update the app, you can make changes
to the Setup, Navigation, and Permissions tabs, and when ready, you can select the Update
app button.

6.3 Monitor usage and performance


Knowing about the usage and performance of your workspace is crucial because it:

 Focuses your efforts for improvement. If you know the areas that experience the worst
performance, you can concentrate your efforts for improvement in those areas.
 Quantifies the impact of your reports. Usage metrics help you determine your reports'
success.

These performance and usage metrics are available features that you can use in a workspace.
With these metrics, you can view who's using your reports, what actions are being done on the
reports, and what performance issues exist.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 149


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

For example, consider the continuing scenario where you work for Tailwind Traders. You've
successfully added reports to your workspace, published an app, and begun the process of
collaborating with the Products team. Commentary begins to circulate around the company
about how useful these workspaces are, resulting in more users being added to the workspace.
The Sales team knows that performance might worsen with the increased addition of users.
Consequently, the Sales team has asked you to monitor usage and performance of the
workspace.

Configure and view usage metric reports

Usage metric reports are available for Power BI Pro users and can only be accessed by users
with the role types of Admin, Member, or Contributor.

To view usage metric reports, go to the pertinent workspace. Find the report or dashboard that
you want to see usage metrics for. For example, if you want to see the usage metrics report for
Sales Data, select the ellipsis (...), and then select View usage metrics report from the drop-
down menu.

When the usage metrics report is ready for viewing, you will receive a prompt that will direct
you to a dashboard. In the Report usage tab, you can view such details as:

 Viewers per day, Unique viewers per day (which doesn't include users who
returned to the same reports multiple times), and Shares per day charts
 Total Views, Total Viewers, and Total Shares KPI cards
 Total views and shares ranking (compares how your report is doing in comparison
to other reports in the app)
 Views by Users (details about each specific user that viewed the dashboard)

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 150


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You can also filter by the distribution method of the report (for example, through sharing or
from the workspace directly) and platform type (for example, mobile or web).

You can also view performance metrics on the Report performance tab, as shown in the
following screenshot.

On the Report performance tab, you can view metrics such as:

 Typical opening time - How long it takes, at the fiftieth percentile, to open the report.
 Opening time trend - How the typical opening time changes over time. This metric
can tell you how the report is performing as the number of users starts to grow.
 Daily/7-Day Performance charts - Highlight the performance for 10, 50, and 90
percent of the open-report actions every day and over a seven-day period.
 Filters for date, so you can see how the performance changes according to the day.

For more information, see Monitor Usage Metrics.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 151


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

6.4 Recommend a development life cycle strategy


The development process is iterative; it typically requires building an initial solution, testing
the solution in a different environment, returning to make necessary revisions, and eventually
releasing a final product. This process is known as a development life cycle. This process can
take place in several different ways and in different environments.

To continue with the module scenario, the Sales team at Tailwind Traders is impressed with
the reports that you have delivered, and as they continue to use the abilities of Power BI, they
also want to maintain data and report integrity without slowing development timelines. As a
result, they have asked you to create a development pipeline that will be used by all teams to
develop reports and dashboards. Power BI provides deployment pipelines that you can use to
help accelerate development and minimize errors.

Deployment pipeline (Premium)

The deployment pipeline feature in Power BI manages content in dashboards, reports, and
datasets between different environments in the development life cycle. With this feature, you
can develop and test Power BI content in one centralized location and streamline the process
before deploying the final content to your users. This Power BI Premium feature requires you
to be a Capacity admin.

The advantages of using the deployment pipeline are:

 Increased productivity - Through this feature, you can reuse previous deployment
pipelines, ensuring that efforts aren't duplicated.
 Faster delivery of content - Report development becomes more streamlined, meaning
that it takes less time to get to production.
 Lower human intervention required - Having the ability to reuse deployment
pipelines means a decreased chance of error associated with moving content from one
environment to another.

Development environments

Typically, development and collaboration occur in different stages. Reports and dashboards are
built in and iterated on a series of controlled stages, or environments, where several tasks occur:

 Development - The location in which dashboard developers or data modelers can build
new content with other developers. This stage is first in the deployment pipeline.
 Test - Where a small group of users and user acceptance testers can see and review new
reports, provide feedback, and test the reports with larger datasets for bugs and data
inconsistencies before it goes into production.
 Production - Where an expansive user audience can use tested reports that are reliable
and accurate. This stage is the final one of the deployment pipeline.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 152


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You can choose which one of these development environments that you want to include in your
deployment pipeline, according to your business needs. For example, you can choose to only
include the Test and Production environments, if necessary.

Configuration of deployment pipelines

In the scenario with Tailwind Traders, you want to create a deployment pipeline. To configure
a deployment pipeline, go to Power BI service, and then follow these steps:

1. On the ribbon on the left side of the page, select Deployment pipelines, as shown in the following
screenshot.

2. On the resulting page, select Create a pipeline.


3. Create a deployment pipeline called SalesPipeline. Enter the Pipeline name as
SalesPipeline and enter a description, if necessary.
4. Select Create, which will take you to the following screen.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 153


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

This view shows you the steps of the development life cycle: Development, Test, and
Production.

5. To create your pipeline, assign workspaces to each of these stages to facilitate where
your reports and dashboards will be housed during each stage.
6. Select Assign a workspace to begin.
7. You will be directed to the Assign the workspace to a deployment stage window,
where you can add the Tailwind Traders workspace to the Development environment.

Only workspaces that are assigned to a Premium capacity will appear. Additionally, you can
only assign a single workspace to each pipeline. Power BI will auto generate the two other
workspaces that are used in the pipeline.

8. If you already have Development, Test, and Production workspaces, choose one that you want to work
with and then select Assign.

If this step is successful, you should see the resulting view.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 154


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The preceding image shows how many datasets, reports, and dashboards that you have in the
current Development environment. At every stage, you have the option to publish the
associated workspace as an app by selecting Publish app.

9. To view all objects that constitute the workspace, select Show more.

Testing stage

After you have collaborated with the teams and built a testing-ready report, you are ready to
proceed to the testing phase. Select Deploy to test, which will create a new workspace. This
workspace, by default, has the same name as the initial workspace but includes the [Test]
suffix. You can change the name by entering the workspace's settings within the deployment
pipeline interface.

Testing should emulate conditions that objects will experience after they've been deployed for
users. Therefore, Power BI allows you to change the source of data that is used during testing.
To accomplish this task, you will first need to enter the environment's deployment settings by
selecting the lightning icon, as shown in the following screenshot.

In the resulting Settings window, select the correct dataset. In this example, you want the
OrdersFigures dataset to be used for testing but with a different data source. To accomplish
this task, create parameters in Power Query Parameters (which will be discussed in a later
module) or add a new rule, which is the process that is used for this example. Under the Data
source rules drop-down menu, select + Add rule.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 155


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

On the Data source rules section, you can change the data source (which was used in
development) to a new source, which is used for testing the reports (orders.csv in the following
example). When you are finished, select Save at the bottom of the card.

Production stage

Now, you are close to completing the pipeline, transitioning from development to testing, and
finally to production. At this stage, you need to create a data source rule for the OrdersFigures
dataset in the workspace to ensure that you are using production data. In this instance, you will
be changing your source from the test to the production folder version of the orders.csv file, as
shown in the following screenshot.

After performing a dataset refresh, your production workspace will be ready. You can package
the workspace as an app, which is available for users. Currently, your deployment pipeline will
appear as shown in the following figure.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 156


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You have successfully created a deployment pipeline from the development to the testing
phase. The following section describes additional operations that you can conduct in the
development pipeline.

Additional operations in the development pipeline

You have created a deployment pipeline and have begun collaborating with other report
developers. You receive notification that one of the other developers has modified a report. To
see the changes to this report, select the Compare button, as shown in the following screenshot.

Selecting Compare reveals that the OrdersFigures report differs between the Development
and Test environments.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 157


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The difference is typically registered as added or removed objects. If you decide that the
changes shouldn't be deployed to the next phase, you can choose to ignore the changes. For
instance, the other developer has added a report called AdditionalOrderInfo in the
Development environment, but you don't want to deploy these changes. By selecting a specific
report and then selecting Deploy to test, you can effectively choose which reports that you
want to move from environment to environment, as shown in the following figure.

As the following message indicates, only one change will be carried over.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 158


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Exercise caution with this tool. Reports are dependent on their datasets. If a dataset has
changed, but you don't deploy it with an associated report, the report will not behave
correctly.

We recommend that you use deployment pipelines in Power BI service. This tool ensures that
the development life cycle is streamlined and that you can create one centralized location to
collaborate, keep track of, and deploy your reports.

6.5 Troubleshoot data by viewing its lineage


The Lineage view feature in Power BI allows you to quickly refresh datasets and see the
relationships between the artifacts in a workspace and their external dependencies.

Consider this module's continuing scenario with Tailwind Traders as an example. Thus far,
you've developed several reports and have published them to the Tailwind workspace.
However, because you are also collaborating with the Products team, it has become
increasingly difficult to track which reports need to be refreshed and which datasets are in
which report. Consequently, you want the ability to determine which datasets need to be
refreshed because you've been receiving reports of stale data. The path of data from its source
to the destination can often be a considerable challenge, more so if you have multiple datasets.

The Lineage view feature can help you accomplish this task efficiently and almost effortlessly.

Data lineage

Data lineage refers to the path that data takes from the data source to the destination.

The Lineage view feature in Power BI is crucial because it:

 Simplifies the troubleshooting process because you can see the path that the data takes
from source to destination and determine pain points and bottlenecks.
 Allows you to manage your workspaces and observe the impact of a single change in
one dataset to reports and dashboards.
 Saves time by simplifying your task of identifying reports and dashboards that haven't
been refreshed.

Use the Lineage view

The Lineage view is only accessible to Admin, Contributor, and Member roles.
Additionally, it requires a Power BI Pro license and is only available for app workspaces. To
access the Lineage view, go to the workspace, and then select Lineage from the View drop-
down menu on the top ribbon.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 159


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

When the view canvas opens, you can begin to explore this view. The following example
shown an excerpt of the data lineage for the Tailwind Sales workspace.

This view shows all the artifacts in your workspace. Artifacts include data sources, datasets
and dataflows, reports, and dashboards. Each card represents an artifact, and the arrows in
between these cards represent the flow of data or the relationship between different artifacts.
By following the arrows from left to right, you can observe the flow of data from the source to
the destination, which will often be a dashboard. Typically, the flow would be data sources >
datasets/dataflows > reports > dashboards.

Data sources

Each of the following cards is a data source that is used in your workspace.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 160


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The card tells you the type of data source (for example, Text/CSV) and the Gateway, which
tells you the source of your data. If you are connected to the data through an on-premises data
gateway, this card will tell you more information about the gateway. Additionally, if you
double-click the card, you will get more details about the data source, such as the file path and
the connection status.

Selecting the lower-right icon on the card will highlight the path from the data source to the
destination, as shown in the following screenshot, which clarifies the exact path that the data
takes.

Next are the datasets/dataflows, which are marked in blue.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 161


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Datasets/dataflows

Often, datasets and dataflows can connect to external data sources, such as SQL Server, or to
external datasets in other workspaces. The following examples show dataset and dataflow cards
on the Lineage view.

The Lineage view uses arrows to connect objects, such as datasets, with their data sources. On
these cards, you can see when the dataset was last refreshed, and you can refresh the dataset by
selecting the arrow icon on the lower-left corner of the card, as shown in the following
screenshot.

This component is a powerful troubleshooting feature that helps ensure that your dataset
refreshes are quick and uncomplicated.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 162


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Returning to the initial quandary with Tailwind Traders, you wanted to determine if the
company had stale datasets and then quickly refresh the data. By using the Lineage view
feature, you can go through the different datasets in one view and then use the Refresh data
button to refresh datasets that you determine as stale.

Additionally, if a dataset or dataflow belongs to a different workspace (in this case, the
Tailwind workspace), it will be indicated on the card, as shown in the following screenshot.

By double-clicking on any card, you can view the metadata, such as the sensitivity, by whom
it was configured, the last refresh date, and the names and count of tables within this dataset,
as shown in the following figure.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 163


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 164


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You can also view the impact of this dataset across workspaces. By selecting the overlapping
window icon on the lower-right corner of a dataset card, you can determine the impact analysis
of the dataset.

On the Impact analysis window, you can see how many workspaces, reports, and dashboards
that this dataset is a part of and how many views that this dataset has gathered, as shown in the
following screenshot.

The bottom of the Impact Analysis window includes more detail about which specific reports
and dashboards that this dataset is part of. Additionally, you can select Notify contacts, which

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 165


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

allows you to notify dataset owners (or any other user) of changes in the dataset. Impact
analysis is useful because it allows you to pinpoint datasets that aren't being used or looked at.

Reports and dashboards

The reports and dashboards cards have similar functionality as the data source and dataset
cards.

Selecting a card will bring up a window in which you can view the metadata about the report
or dashboard. In this window, you can also go directly to the report or dashboard. You can also
enable or disable whether you want to include this report or dashboard within the app.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 166


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

This card also contains useful options under the ellipsis (...), as shown in the following figure.
From this menu, you can select to analyze the report in Microsoft Excel, delete a report, create
Quick Insights, save a copy to a workspace, and more.

Now that you have had an in-depth look into the Lineage view in Power BI, you can commence
with cleaning up the Tailwind Traders workspace. For more information, see Data Lineage.

6.6 Configure data protection


As enterprises grow, so does their data. Often, strict requirements and regulations must be
applied to ensure that this sensitive data is secure. Power BI provides a few different ways to
help you accomplish this task:

 Use Microsoft sensitivity labels to label dashboards, reports, datasets, and dataflows by
using the same taxonomy that is used to classify and protect files in Microsoft 365.
 Add more protection measures such as encryption and watermarks when you are
exporting the data.
 Use Microsoft Cloud App Security to monitor and investigate activities in Power BI.

To continue with the module scenario, as more reports and dashboards are increasingly added
to the Tailwind Traders workspace, the Sales team becomes concerned as they realize the
urgency of securing their data. The team is concerned about the possibility of new users
exporting data without permission. The Sales team doesn't want to roll back reports or
dashboards, so they have asked you to implement comprehensive security measures that protect

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 167


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

data access within and outside of Power BI. You can complete this task by configuring data
protection labels in Power BI.

Before you begin, ensure that you have the appropriate licensing, as shown here.

Sensitivity labels

Sensitivity labels specify which data can be exported. These labels are configured externally
to Power BI, and Power BI allows you to quickly use them in your reports and dashboards.
These labels allow you to define and protect content, even outside of Power BI. Datasets,
dataflows, reports, and dashboards can use this mechanism, and all users in your corporation
can use this feature unless exceptions have been defined.

After you have verified your ability to add labels, go to any workspace and choose an object to
secure. For this example, you will add a sensitivity label to Sales Data by going to the
workspace and, under the ellipsis (...), selecting Settings.

This selection will take you to a window, where you can assign a sensitivity label to your data.
For this example, the following labels have been externally configured, so you can now apply
them to the data: None, Personal, General, Confidential, and Highly confidential. You can
also go to Microsoft 365 Security Center to define your own labels.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 168


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

For example, if you want to assign a Confidential label to your Sales Data report, when you
change this label on the Settings pane, it will appear as a label on the report, as shown in the
following figure.

This factor is crucial when you are exporting data. Data that is exported to Microsoft Excel,
Microsoft PowerPoint, and PDF files will have sensitivity labels enforced. For instance, if you
wanted to export data from Sales Data into an Excel file, if you are an authorized user, you
will see the following Excel view when you export into Excel.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 169


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

However, if you didn't have established permissions, you would be denied access to see the
data. This verification ensures that only appropriate users have access to view the data, which
helps make sure that your data is secured.

Check your knowledge


Answer the following questions to see what you've learned.
1. How is the Admin workspace role different from other types of workspace roles?

Admin is the only role that can remove users.

Only Admins can add and remove users from a workspace.

Admin is the only role that can publish or update apps.

Admin is the only role that can create, edit, or delete content in a workspace.

Admin is the only role that can publish content to a workspace.


2. Which one of the following options is the best description of a workspace?

A workspace is a feature in Power BI service that allows you to view reports only.

A workspace is a feature of Power BI Desktop that allows you to build reports only.

A workspace is a centralized location or repository that allows you to collaborate with colleagues and
teams to create collections of reports, dashboards, and so on.

A workspace is a centralized location or repository that allows you to collaborate with


colleagues and teams to create collections of reports, dashboards, and so on.

A workspace is a feature that allows you to view and edit the data model, build visualizations, and
transform the data.
3.

What feature in Power BI service can you use to troubleshoot the flow of data from its source
to its destination?

Usage Metrics report

Query Caching

Quick Insights

Lineage view

Lineage view allows you to view and troubleshoot the data flow from source to destination.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 170


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Summary
A workspace is a crucial feature of Power BI that allows you to share reports, build
dashboards, and collaborate with your teams. Power BI workspaces can help increase
performance in your reports, ensure that appropriate security requirements are applied, make
it easier for you to share content, and more. With this information, you can add to your toolkit
the ability to manage workspaces in Power BI service so that you can build your dashboards
in the most efficient way possible.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 171


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Unit 7:
Key Influencers Visualizations Tutorial - Power
BI

7.1. Create key influencers visualizations


APPLIES TO: ✔️ Power BI Desktop ✔️ Power BI service

The key influencers visual helps you understand the factors that drive a metric you're interested
in. It analyzes your data, ranks the factors that matter, and displays them as key influencers.
For example, suppose you want to figure out what influences employee turnover, which is also
known as churn. One factor might be employment contract length, and another factor might be
commute time.

When to use key influencers

The key influencers visual is a great choice if you want to:

 See which factors affect the metric being analyzed.


 Contrast the relative importance of these factors. For example, do short-term contracts affect churn
more than long-term contracts?

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 172


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Features of the key influencers visual

1. Tabs: Select a tab to switch between views. Key influencers shows you the top
contributors to the selected metric value. Top segments shows you the top segments
that contribute to the selected metric value. A segment is made up of a combination of
values. For example, one segment might be consumers who have been customers for at
least 20 years and live in the west region.
2. Drop-down box: The value of the metric under investigation. In this example, look at
the metric Rating. The selected value is Low.
3. Restatement: It helps you interpret the visual in the left pane.
4. Left pane: The left pane contains one visual. In this case, the left pane shows a list of
the top key influencers.
5. Restatement: It helps you interpret the visual in the right pane.
6. Right pane: The right pane contains one visual. In this case, the column chart displays
all the values for the key influencer Theme that was selected in the left pane. The
specific value of usability from the left pane is shown in green. All the other values for
Theme are shown in black.
7. Average line: The average is calculated for all possible values for Theme except
usability (which is the selected influencer). So the calculation applies to all the values
in black. It tells you what percentage of the other Themes had a low rating. In this case
11.35% had a low rating (shown by the dotted line).
8. Check box: Filters out the visual in the right pane to only show values that are
influencers for that field. In this example, the visual is filtered to display usability,
security, and navigation.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 173


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

7.2. Analyze a metric that is categorical


Watch this video to learn how to create a key influencers visual with a categorical metric. Then
follow the steps to create one.

Note

This video might use earlier versions of Power BI Desktop or the Power BI service.

 Power BI Desktop
 Power BI service

1. Your Product Manager wants you to figure out which factors lead customers to leave negative reviews
about your cloud service. To follow along in Power BI Desktop, open the Customer Feedback PBIX file.

Note

The Customer Feedback data set is based on [Moro et al., 2014] S. Moro, P. Cortez, and P.
Rita. "A Data-Driven Approach to Predict the Success of Bank Telemarketing." Decision
Support Systems, Elsevier, 62:22-31, June 2014.

2. Under Build visual on the Visualizations pane, select the Key influencers icon.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 174


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

3. Move the metric you want to investigate into the Analyze field. To see what drives a
customer rating of the service to be low, select Customer Table > Rating.
4. Move fields that you think might influence Rating into the Explain by field. You can
move as many fields as you want. In this case, start with:
o Country-Region
o Role in Org
o Subscription Type
o Company Size
o Theme
5. Leave the Expand by field empty. This field is only used when analyzing a measure or
summarized field.
6. To focus on the negative ratings, select Low in the What influences Rating to be drop-
down box.

The analysis runs on the table level of the field that's being analyzed. In this case, it's the Rating
metric. This metric is defined at a customer level. Each customer has given either a high score
or a low score. All the explanatory factors must be defined at the customer level for the visual
to make use of them.

In the previous example, all of the explanatory factors have either a one-to-one or a many-to-
one relationship with the metric. In this case, each customer assigned a single theme to their
rating. Similarly, customers come from one country or region, have one membership type, and

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 175


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

hold one role in their organization. The explanatory factors are already attributes of a customer,
and no transformations are needed. The visual can make immediate use of them.

Later in the tutorial, you look at more complex examples that have one-to-many relationships.
In those cases, the columns have to first be aggregated down to the customer level before you
can run the analysis.

Measures and aggregates used as explanatory factors are also evaluated at the table level of the
Analyze metric. Some examples are shown later in this article.

7.3 Interpret categorical key influencers


Let's take a look at the key influencers for low ratings.

Top single factor that influences the likelihood of a low rating

The customer in this example can have three roles: consumer, administrator, and publisher.
Being a consumer is the top factor that contributes to a low rating.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 176


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

More precisely, your consumers are 2.57 times more likely to give your service a negative
score. The key influencers chart lists Role in Org is consumer first in the list on the left. By
selecting Role in Org is consumer, Power BI shows more details in the right pane. The
comparative effect of each role on the likelihood of a low rating is shown.

 14.93% of consumers give a low score.


 On average, all other roles give a low score 5.78% of the time.
 Consumers are 2.57 times more likely to give a low score compared to all other roles. You can determine
this score by dividing the green bar by the red dotted line.

Second single factor that influences the likelihood of a low rating

The key influencers visual compares and ranks factors from many different variables. The
second influencer has nothing to do with Role in Org. Select the second influencer in the list,
which is Theme is usability.

The second most important factor is related to the theme of the customer’s review. Customers
who commented about the usability of the product were 2.55 times more likely to give a low
score compared to customers who commented on other themes, such as reliability, design, or
speed.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 177


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Between the visuals, the average, which is shown by the red dotted line, changed from 5.78%
to 11.35%. The average is dynamic because it's based on the average of all other values. For
the first influencer, the average excluded the customer role. For the second influencer, it
excluded the usability theme.

Select the Only show values that are influencers check box to filter by using only the
influential values. In this case, they're the roles that drive a low score. 12 themes are reduced
to the four that Power BI identified as the themes that drive low ratings.

7.4 Interact with other visuals


Every time you select a slicer, filter, or other visual on the canvas, the key influencers visual
reruns its analysis on the new portion of data. For example, you can move Company Size into
the report and use it as a slicer. Use it to see if the key influencers for your enterprise customers
are different than the general population. An enterprise company size is larger than 50,000
employees.

Select >50,000 to rerun the analysis, and you can see that the influencers changed. For large
enterprise customers, the top influencer for low ratings has a theme related to security. You

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 178


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

might want to investigate further to see if there are specific security features your large
customers are unhappy about.

Interpret continuous key influencers

So far, you've seen how to use the visual to explore how different categorical fields influence
low ratings. It's also possible to have continuous factors such as age, height, and price in the
Explain by field. Let’s look at what happens when Tenure is moved from the customer table
into Explain by. Tenure depicts how long a customer has used the service.

As tenure increases, the likelihood of receiving a lower rating also increases. This trend
suggests that the longer-term customers are more likely to give a negative score. This insight
is interesting, and one that you might want to follow up on later.

The visualization shows that every time tenure goes up by 13.44 months, on average the
likelihood of a low rating increases by 1.23 times. In this case, 13.44 months depict the standard
deviation of tenure. So the insight you receive looks at how increasing tenure by a standard
amount, which is the standard deviation of tenure, affects the likelihood of receiving a low
rating.

The scatter plot in the right pane plots the average percentage of low ratings for each value of
tenure. It highlights the slope with a trend line.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 179


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Binned continuous key influencers

In some cases, you may find that your continuous factors were automatically turned into
categorical ones. If the relationship between the variables isn't linear, we can't describe the
relationship as simply increasing or decreasing (like we did in the example above).

We run correlation tests to determine how linear the influencer is with regard to the target. If
the target is continuous, we run Pearson correlation and if the target is categorical, we run Point
Biserial correlation tests. If we detect the relationship isn't sufficiently linear, we conduct
supervised binning and generate a maximum of five bins. To figure out which bins make the
most sense, we use a supervised binning method that looks at the relationship between the
explanatory factor and the target being analyzed.

Interpret measures and aggregates as key influencers

You can use measures and aggregates as explanatory factors inside your analysis. For example,
you might want to see what effect the count of customer support tickets or the average duration
of an open ticket has on the score you receive.

In this case, you want to see if the number of support tickets that a customer has influences the
score they give. Now you bring in Support Ticket ID from the support ticket table. Because a
customer can have multiple support tickets, you aggregate the ID to the customer level.
Aggregation is important because the analysis runs on the customer level, so all drivers must
be defined at that level of granularity.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 180


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Let's look at the count of IDs. Each customer row has a count of support tickets associated with
it. In this case, as the count of support tickets increases, the likelihood of the rating being low
goes up 4.08 times. The visual on the right shows the average number of support tickets by
different Rating values evaluated at the customer level.

Interpret the results: Top segments

You can use the Key influencers tab to assess each factor individually. You also can use the
Top segments tab to see how a combination of factors affects the metric that you're analyzing.

Top segments initially show an overview of all the segments that Power BI discovered. The
following example shows that six segments were found. These segments are ranked by the
percentage of low ratings within the segment. Segment 1, for example, has 74.3% customer
ratings that are low. The higher the bubble, the higher the proportion of low ratings. The size
of the bubble represents how many customers are within the segment.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 181


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Selecting a bubble displays the details of that segment. If you select Segment 1, for example,
you find that it's made up of relatively established customers. They've been customers for over
29 months and have more than four support tickets. Finally, they're not publishers, so they're
either consumers or administrators.

In this group, 74.3% of the customers gave a low rating. The average customer gave a low
rating 11.7% of the time, so this segment has a larger proportion of low ratings. It's 63
percentage points higher. Segment 1 also contains approximately 2.2% of the data, so it
represents an addressable portion of the population.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 182


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Adding counts

Sometimes an influencer can have a significant effect but represent little of the data. For
example, Theme is usability is the third biggest influencer for low ratings. However, there
might have only been a handful of customers who complained about usability. Counts can help
you prioritize which influencers you want to focus on.

You can turn on counts through the Analysis card of the formatting pane.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 183


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

After counts are enabled, you’ll see a ring around each influencer’s bubble, which represents
the approximate percentage of data that influencer contains. The more of the bubble the ring
circles, the more data it contains. We can see that Theme is usability contains a small
proportion of data.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 184


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You can also use the Sort by toggle in the bottom left of the visual to sort the bubbles by count
first instead of impact. Subscription Type is Premier is the top influencer based on count.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 185


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Having a full ring around the circle means the influencer contains 100% of the data. You can
change the count type to be relative to the maximum influencer using the Count type dropdown
in the Analysis card of the formatting pane. Now the influencer with the most amount of data
will be represented by a full ring and all other counts will be relative to it.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 186


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Analyze a metric that is numeric

If you move an unsummarized numerical field into the Analyze field, you have a choice how
to handle that scenario. You can change the behavior of the visual by going into the Formatting
Pane and switching between Categorical Analysis Type and Continuous Analysis Type.

A Categorical Analysis Type behaves as described above. For instance, if you were looking
at survey scores ranging from 1 to 10, you could ask ‘What influences Survey Scores to be 1?’

A Continuous Analysis Type changes the question to a continuous one. In the example above,
our new question would be ‘What influences Survey Scores to increase/decrease?’

This distinction is helpful when you have lots of unique values in the field you're analyzing. In
the example below, we look at house prices. It isn't meaningful to ask ‘What influences House
Price to be 156,214?’ as that is very specific and we're likely not to have enough data to infer
a pattern.

Instead we may want to ask, ‘What influences House Price to increase’? which allows us to
treat house prices as a range rather than distinct values.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 187


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Interpret the results: Key influencers

Note

The examples in this section use public domain House Prices data. You can download the
sample dataset if you want to follow along.

In this scenario, we look at ‘What influences House Price to increase’. A number of explanatory
factors could impact a house price like Year Built (year the house was built), KitchenQual
(kitchen quality), and YearRemodAdd (year the house was remodeled).

In the example below, we look at our top influencer which is kitchen quality being Excellent.
The results are similar to the ones we saw when we were analyzing categorical metrics with a
few important differences:

 The column chart on the right is looking at the averages rather than percentages. It therefore shows us
what the average house price of a house with an excellent kitchen is (green bar) compared to the
average house price of a house without an excellent kitchen (dotted line)
 The number in the bubble is still the difference between the red dotted line and green bar but it’s
expressed as a number
(158.49K)ratherthanalikelihood(1.93x).Soonaverage,houseswithexcellentkit
chensarealmost

 160K more expensive than houses without excellent kitchens.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 188


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

In the example below, we look at the impact a continuous factor (year house was remodeled)
has on house price. The differences compared to how we analyze continuous influencers for
categorical metrics are as follows:

 The scatter plot in the right pane plots the average house price for each distinct value of year
remodeled.
 The value in the bubble shows by how much the average house price increases (in this case $2.87k)
when the year the house was remodeled increases by its standard deviation (in this case 20 years)

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 189


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Finally, in the case of measures, we're looking at the average year a house was built. The
analysis is as follows:

 The scatterplot in the right pane plots the average house price for each distinct value in the table
 The value in the bubble shows by how much the average house price increases (in this case $1.35K)
when the average year increases by its standard deviation (in this case 30 years)

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 190


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Interpret the results: Top Segments

Top segments for numerical targets show groups where the house prices on average are higher
than in the overall dataset. For example, below we can see that Segment 1 is made up of houses
where GarageCars (number of cars the garage can fit) is greater than 2 and the RoofStyle is
Hip. Houses with those characteristics have an average price of
355Kcomparedtotheoverallaverageinthedatawhichis

180K.

Analyze a metric that is a measure or a summarized column

In the case of a measure or summarized column the analysis defaults to the Continuous
Analysis Type described above. It can't be changed. The biggest difference between analyzing
a measure/summarized column and an unsummarized numeric column is the level at which the
analysis runs.

In the case of unsummarized columns, the analysis always runs at the table level. In the house
price example above, we analyzed the House Price metric to see what influences a house price
to increase/decrease. The analysis automatically runs on the table level. Our table has a unique
ID for each house so the analysis runs at a house level.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 191


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

For measures and summarized columns, we don't immediately know what level to analyze them
at. If House Price was summarized as an Average, we would need to consider what level we
would like this average house price calculated. Is it the average house price at a neighborhood
level? Or perhaps a regional level?

Measures and summarized columns are automatically analyzed at the level of the Explain by
fields used. Imagine we have three fields in Explain By we're interested in: Kitchen Quality,
Building Type and Air Conditioning. Average House Price would be calculated for each
unique combination of those three fields. It's often helpful to switch to a table view to take a

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 192


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

look at what the data being evaluated looks like.

This analysis is very summarized and so it will be hard for the regression model to find any
patterns in the data it can learn from. We should run the analysis at a more detailed level to get
better results. If we wanted to analyze the house price at the house level, we'd need to explicitly
add the ID field to the analysis. Nevertheless, we don't want the house ID to be considered an
influencer. It isn't helpful to learn that as house ID increases, the price of a house increase. The
Expand By field well option comes in handy here. You can use Expand By to add fields you
want to use for setting the level of the analysis without looking for new influencers.

Take a look at what the visualization looks like once we add ID to Expand By. Once you've
defined the level at which you want your measure evaluated, interpreting influencers is exactly
the same as for unsummarized numeric columns.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 193


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

If you would like to learn more about how you can analyze measures with the key influencers
visualization, please watch the following video. To learn how Power BI uses ML.NET behind
the scenes to reason over data and surface insights in a natural way, see Power BI identifies
key influencers using ML.NET.

Considerations and troubleshooting

What are the limitations for the visual?

The key influencers visual has some limitations:

 Direct Query is not supported


 Live Connection to Azure Analysis Services and SQL Server Analysis Services is not supported
 Publish to web is not supported
 .NET Framework 4.6 or higher is required
 SharePoint Online embedding isn't supported

I see an error that no influencers or segments were found. Why is that?

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 194


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

This error occurs when you included fields in Explain by but no influencers were found.

 You included the metric you were analyzing in both Analyze and Explain by. Remove it from Explain
by.
 Your explanatory fields have too many categories with few observations. This situation makes it hard
for the visualization to determine which factors are influencers. It’s hard to generalize based on only a
few observations. If you're analyzing a numeric field, you may want to switch from Categorical Analysis
to Continuous Analysis in the Formatting Pane under the Analysis card.
 Your explanatory factors have enough observations to generalize, but the visualization didn't find any
meaningful correlations to report.

I see an error that the metric I'm analysing doesn't have enough data to run the analysis
on. Why is that?

The visualization works by looking at patterns in the data for one group compared to other
groups. For example, it looks for customers who gave low ratings compared to customers who
gave high ratings. If the data in your model has only a few observations, patterns are hard to
find. If the visualization doesn’t have enough data to find meaningful influencers, it indicates
that more data is needed to run the analysis.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 195


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

We recommend that you have at least 100 observations for the selected state. In this case, the
state is customers who churn. You also need at least 10 observations for the states you use for
comparison. In this case, the comparison state is customers who don't churn.

If you're analyzing a numeric field, you may want to switch from Categorical Analysis to
Continuous Analysis in the Formatting Pane under the Analysis card.

I see an error that when 'Analyze' is not summarized, the analysis always runs at the row
level of its parent table. Changing this level via 'Expand by' fields is not allowed. Why is
that?

When analyzing a numeric or categorical column, the analysis always runs at the table level.
For example, if you're analyzing house prices and your table contains an ID column, the
analysis will automatically run at the house ID level.

When you're analyzing a measure or summarized column, you need to explicitly state at which
level you would like the analysis to run at. You can use Expand by to change the level of the
analysis for measures and summarized columns without adding new influencers. If House
price was defined as a measure, you could add the house ID column to Expand by to change
the level of the analysis.

I see an error that a field in Explain by isn't uniquely related to the table that contains the
metric I'm analyzing. Why is that?

The analysis runs on the table level of the field that's being analyzed. For example, if you
analyze customer feedback for your service, you might have a table that tells you whether a
customer gave a high rating or a low rating. In this case, your analysis is running at the customer
table level.

If you have a related table that's defined at a more granular level than the table that contains
your metric, you see this error. Here's an example:

 You analyze what drives customers to give low ratings of your service.
 You want to see if the device on which the customer is consuming your service influences the reviews
they give.
 A customer can consume the service in multiple different ways.
 In the following example, customer 10000000 uses both a browser and a tablet to interact with the
service.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 196


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

If you try to use the device column as an explanatory factor, you see the following error:

This error appears because the device isn't defined at the customer level. One customer can
consume the service on multiple devices. For the visualization to find patterns, the device must
be an attribute of the customer. There are several solutions that depend on your understanding
of the business:

 You can change the summarization of devices to count. For example, use count if the number of devices
might affect the score that a customer gives.
 You can pivot the device column to see if consuming the service on a specific device influences a
customer’s rating.

In this example, the data was pivoted to create new columns for browser, mobile, and tablet
(make sure you delete and re-create your relationships in the modeling view after pivoting your
data). You can now use these specific devices in Explain by. All devices turn out to be
influencers, and the browser has the largest effect on customer score.

More precisely, customers who don't use the browser to consume the service are 3.79 times
more likely to give a low score than the customers who do. Lower down in the list, for mobile
the inverse is true. Customers who use the mobile app are more likely to give a low score than
the customers who don’t.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 197


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

I see a warning that measures weren't included in my analysis. Why is that?

The analysis runs on the table level of the field that's being analyzed. If you analyze customer
churn, you might have a table that tells you whether a customer churned or not. In this case,
your analysis runs at the customer table level.

Measures and aggregates are by default analyzed at the table level. If there were a measure for
average monthly spending, it would be analyzed at the customer table level.

If the customer table doesn't have a unique identifier, you can't evaluate the measure and it's
ignored by the analysis. To avoid this situation, make sure the table with your metric has a
unique identifier. In this case, it's the customer table and the unique identifier is customer ID.
It’s also easy to add an index column by using Power Query.

I see a warning that the metric I'm analyzing has more than 10 unique values and that
this amount might affect the quality of my analysis. Why is that?

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 198


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

The AI visualization can analyze categorical fields and numeric fields. In the case of categorical
fields, an example may be Churn is Yes or No, and Customer Satisfaction is High, Medium, or
Low. Increasing the number of categories to analyze means there are fewer observations per
category. This situation makes it harder for the visualization to find patterns in the data.

When analyzing numeric fields, you have a choice between treating the numeric fields like text
in which case you'll run the same analysis as you do for categorical data (Categorical
Analysis). If you have lots of distinct values, we recommend you switch the analysis to
Continuous Analysis as that means we can infer patterns from when numbers increase or
decrease rather than treating them as distinct values. You can switch from Categorical
Analysis to Continuous Analysis in the Formatting Pane under the Analysis card.

To find stronger influencers, we recommend that you group similar values into a single unit.
For example, if you have a metric for price, you're likely to obtain better results by grouping
similar prices into High, Medium, and Low categories vs. using individual price points.

There are factors in my data that look like they should be key influencers, but they aren't.
How can that happen?

In the following example, customers who are consumers drive low ratings, with 14.93% of
ratings that are low. The administrator role also has a high proportion of low ratings, at 13.42%,
but it isn't considered an influencer.

The reason for this determination is that the visualization also considers the number of data
points when it finds influencers. The following example has more than 29,000 consumers and
10 times fewer administrators, about 2,900. Only 390 of them gave a low rating. The visual
doesn’t have enough data to determine whether it found a pattern with administrator ratings or
if it’s just a chance finding.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 199


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

What are the data point limits for key influencers? We run the analysis on a sample of
10,000 data points. The bubbles on the one side show all the influencers that were found. The
column charts and scatterplots on the other side abide by the sampling strategies for those core
visuals.

How do you calculate key influencers for categorical analysis?

Behind the scenes, the AI visualization uses ML.NET to run a logistic regression to calculate
the key influencers. A logistic regression is a statistical model that compares different groups
to each other.

If you want to see what drives low ratings, the logistic regression looks at how customers who
gave a low score differ from the customers who gave a high score. If you have multiple
categories, such as high, neutral, and low scores, you look at how the customers who gave a
low rating differ from the customers who didn't give a low rating. In this case, how do the
customers who gave a low score differ from the customers who gave a high rating or a neutral
rating?

The logistic regression searches for patterns in the data and looks for how customers who gave
a low rating might differ from the customers who gave a high rating. It might find, for example,
that customers with more support tickets give a higher percentage of low ratings than customers
with few or no support tickets.

The logistic regression also considers how many data points are present. For example, if
customers who play an admin role give proportionally more negative scores but there are only
a few administrators, this factor isn't considered influential. This determination is made because
there aren't enough data points available to infer a pattern. A statistical test, known as a Wald
test, is used to determine whether a factor is considered an influencer. The visual uses a p-value
of 0.05 to determine the threshold.

How do you calculate key influencers for numeric analysis?

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 200


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Behind the scenes, the AI visualization uses ML.NET to run a linear regression to calculate the
key influencers. A linear regression is a statistical model that looks at how the outcome of the
field you're analyzing changes based on your explanatory factors.

For example, if we're analyzing house prices, a linear regression will look at the effect that
having an excellent kitchen will have on the house price. Do houses with excellent kitchens
generally have lower or higher house prices compared to houses without excellent kitchens?

The linear regression also considers the number of data points. For example, if houses with
tennis courts have higher prices but we have few houses with a tennis court, this factor isn't
considered influential. This determination is made because there aren't enough data points
available to infer a pattern. A statistical test, known as a Wald test, is used to determine whether
a factor is considered an influencer. The visual uses a p-value of 0.05 to determine the
threshold.

How do you calculate segments?

Behind the scenes, the AI visualization uses ML.NET to run a decision tree to find interesting
subgroups. The objective of the decision tree is to end up with a subgroup of data points that's
relatively high in the metric you're interested in. It could be customers with low ratings or
houses with high prices.

The decision tree takes each explanatory factor and tries to reason which factor gives it the best
split. For example, if you filter the data to include only large enterprise customers, will that
separate out customers who gave a high rating vs. a low rating? Or perhaps is it better to filter
the data to include only customers who commented about security?

After the decision tree does a split, it takes the subgroup of data and determines the next best
split for that data. In this case, the subgroup is customers who commented on security. After
each split, the decision tree also considers whether it has enough data points for this group to
be representative enough to infer a pattern from or whether it's an anomaly in the data and not
a real segment. Another statistical test is applied to check for the statistical significance of the
split condition with p-value of 0.05.

After the decision tree finishes running, it takes all the splits, such as security comments and
large enterprise, and creates Power BI filters. This combination of filters is packaged up as a
segment in the visual.

Why do certain factors become influencers or stop being influencers as I move more fields
into the Explain by field?

The visualization evaluates all explanatory factors together. A factor might be an influencer by
itself, but when it's considered with other factors it might not. Suppose you want to analyze
what drives a house price to be high, with bedrooms and house size as explanatory factors:

 By itself, more bedrooms might be a driver for house prices to be high.


 Including house size in the analysis means you now look at what happens to bedrooms while house size
remains constant.
 If house size is fixed at 1,500 square feet, it's unlikely that a continuous increase in the number of
bedrooms will dramatically increase the house price.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 201


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Unit 8: Smart Narratives Tutorial - Power BI


| Microsoft Docs
Create smart narrative summaries

APPLIES TO: ✔️ Power BI Desktop ✔️ Power BI service

The smart narrative visualization helps you quickly summarize visuals and reports. It
provides relevant innovative insights that you can customize.

Use smart narrative summaries in your reports to address key takeaways, to point out trends,
and to edit the language and format for a specific audience. In PowerPoint, instead of pasting
a screenshot of your report's key takeaways, you can add narratives that are updated with
every refresh. Your audience can use the summaries to understand the data, get to key points
faster, and explain the data to others.

Get started

Watch Justyna show you how to use smart narratives, then try it out yourself using the
tutorial, below the video.

Note

This video might use earlier versions of Power BI Desktop or the Power BI service.

To follow along in Power BI Desktop, open the sample online-sales scenario dataset. If you'd
like to use the Power BI service, you can follow along using a different dataset of your
choosing.

Choose the Products tab, then select the Smart narrative icon in the Visualizations pane to
automatically generate a summary.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 202


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You'll see a narrative that's based on all of the visuals on the page. For example, in the
sample file, smart narratives can automatically generate a summary of the report's visuals that
address revenue, website visits, and sales. Power BI automatically analyzes trends to show
that revenue and visits have both grown. It even calculates growth, which in this case is 72
percent.

To generate a smart narrative of a visualization, right-click it and then select Summarize. For
example, in the sample file, try summarizing a scatter chart that shows various transactions.
Power BI analyzes the data and shows which city or region has the highest revenue per
transaction and the highest number of transactions. The smart narrative also shows the
expected range of values for these metrics. You see that most cities produce less than $45 per
transaction and have fewer than 10 transactions.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 203


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Edit the summary

The smart narrative summary is highly customizable. You can edit or add to the existing text
by using the text box commands. For example, you can make the text bold or change its
color.

To customize the summary or add your own insights, use dynamic values. You can map text
to existing fields and measures or use natural language to define a new measure to map to
text. For example, to add information about the number of returned items in the sample file,
add a value.

As you type a value name, you can choose from a list of suggestions as you do in a Q&A
visual. So, in addition to asking questions of your data in a Q&A visual, you can now create
your own calculations without even using Data Analysis Expressions (DAX).

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 204


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You can also format dynamic values. For example, in the sample file, you can show values as
currency, specify decimal places, and choose a separator for thousands.

To format a dynamic value, select the value in the summary to see your editing options on the
Review tab. Or in the text box, next to the value that you want to edit, select the edit button.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 205


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

You can also use the Review tab to review, delete, or reuse previously defined values. Select
the plus sign (+) to insert the value into the summary. You can also show automatically
generated values by turning on the option at the bottom of the Review tab.

Sometimes a hidden-summary symbol appears in the smart narrative. It indicates that current
data and filters produce no result for the value. A summary is empty when no insights are
available. For example, in the sample file's line chart, a summary of high and low values
might be empty when the chart's line is flat. But the summary might appear under other
conditions. Hidden-summary symbols are visible only when you try to edit a summary.

Visual interactions

A summary is dynamic. It automatically updates the generated text and dynamic values when
you cross-filter. For example, if you select electronics products in the sample file's donut
chart, the rest of the report is cross-filtered, and the summary is also cross-filtered to focus on
the electronics products.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 206


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

In this case, the visits and revenues have different trends, so the summary text is updated to
reflect the trends. The count-of-returns value that we added is updated to $4196. Empty
summaries can be updated when you cross-filter.

You can also do more advanced filtering. For example, in the sample file, look at the visual
of trends for multiple products. If you're interested only in a trend for a certain quarter, then
select the relevant data points to update the summary for that trend.

There's a limit to the number of summaries that can be generated so Smart Narratives picks
the most interesting things to summarize about the visual. Smart Narratives generates up to
four summaries per visual and up to 16 per page. The summaries that are generated for a page
depend on the location and size of visuals and it avoids generating the same kind of
summaries for different visuals. Therefore summarizing just the visual can generate more
summaries that aren't present while summarizing the whole page.

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 207


Skill Enhancement Course (SEC): Artificial Intelligence for BA,BCOM,BSc, BBA, BSW III Sem

Considerations and limitations

The smart narrative feature doesn't support the following functionality:

 Pinning to a dashboard
 Using dynamic values and conditional formatting (for example, data bound title)
 Publish to Web
 Power BI Report Server
 On-premises Analysis Services
 Live Connection to Azure Analysis Services or SQL Server Analysis Services
 MultiDimensional Analysis Services data sources
 Key influencers visual with a categorical metric or unsummarized numerical field as 'Analyze' field
from a table:
o that contains more than one primary key
o without a primary key, and measures or aggregates as 'Explain by' fields
 Map visual with non-aggregated latitude or longitude
 Multi-row card with more than three categorical fields
 Cards with non-numeric measures
 Tables, matrices, R visuals or Python visuals, custom visuals
 Summaries of visuals whose columns are grouped by other columns and for visuals that are built on a
data group field
 Cross-filtering out of a visual
 Renaming dynamic values or editing automatically generated dynamic values
 Summaries of visuals that contain on-the-fly calculations like QnA arithmetic, complex measures such
as percentage of grand total and measures from extension schemas.
 Calculation groups

Dr. Bhagirathi Halalli, Assistant Professor, GFGC Raibag 208

You might also like