Power BI - PL300 - Companion
Power BI - PL300 - Companion
Power BI - PL300 - Companion
Microsof t Power
BI Data Analyst
Certification
Companion
Preparation
for Exam PL-300
›
Jessica Jolly
Certification Study Companion Series
The Apress Certification Study Companion Series offers guidance and hands-on
practice to support technical and business professionals who are studying for an exam
in the pursuit of an industry certification. Professionals worldwide seek to achieve
certifications in order to advance in a career role, reinforce knowledge in a specific
discipline, or to apply for or change jobs. This series focuses on the most widely taken
certification exams in a given field. It is designed to be user friendly, tracking to topics as
they appear in a given exam. Authors for this series are experts and instructors who not
only possess a deep understanding of the content, but also have experience teaching the
key concepts that support readers in the practical application of the skills learned in their
day-to-day roles.
Jessica Jolly
Microsoft Power BI Data Analyst Certification Companion: Preparation for
Exam PL-300
Jessica Jolly
Evanston, IL, USA
Acknowledgments��������������������������������������������������������������������������������������������������xxi
Introduction����������������������������������������������������������������������������������������������������������xxiii
vii
Table of Contents
viii
Table of Contents
Parameters��������������������������������������������������������������������������������������������������������������������������������� 39
Defining Parameters�������������������������������������������������������������������������������������������������������������� 40
Within the Power Query Editor���������������������������������������������������������������������������������������������� 42
In the Power BI Desktop�������������������������������������������������������������������������������������������������������� 43
ix
Table of Contents
x
Table of Contents
xii
Table of Contents
xiii
Table of Contents
xiv
Table of Contents
xv
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 379
xvi
About the Author
Jessica Jolly is a Microsoft Certified Trainer (MCT) who
helps businesses, nonprofits, and individuals improve
their business intelligence skills, bit by byte. She runs her
own business, ALT-Enter, LLC. Before her reinvention
as an entrepreneur (after 50!), she worked for Unilever,
a global consumer products company, for 27 years, in a
variety of managerial roles. Her business practice focuses
on data visualization tools, specifically Microsoft's Power
BI platform. She is living proof that you could cry through
every math class you ever had and still fashion a career that
focuses on data, charts, visuals, and code. When she is not training other adults, she is
knitting and quilting (a refuge from all of the technology!), reading about the Civil War,
swimming, gardening, biking, hiking, and canoeing.
xvii
About the Technical Reviewer
Ginger Grant is a Data Platform MVP who provides
consulting services in advanced analytic solutions, including
machine learning, data warehousing, and Power BI. She
is an author of articles and books and at DesertIsleSQL.
com and uses her MCT to provide data platform training in
topics such as Azure Synapse Analytics, Python, and Azure
Machine Learning.
xix
Acknowledgments
I would like to thank Ginger Grant, my technical editor, for her kindness when correcting
my errors. It takes tact and empathy to tell someone they are wrong, and she has both
in spades.
xxi
Introduction
I cannot honestly say that I have always wanted to write a book. What I can say is that
I have relied on books written by others throughout my learning journey with Power
BI. Call me “old-school,” but having the physical document available to write notes
on, refer to, and reread helps me master a concept, technique, or idea. When Apress
approached me with the idea of writing a book about the PL-300, I was excited and
nervous. Excited because it would give me a chance to “pay it forward”—to help
others who want to pass the PL-300 and, more importantly, become skilled Power BI
practitioners. Nervous because I worried that I wouldn’t be able to write cogently and
succinctly about all the topics covered by the PL-300.
In the process of writing, I had to research some topics further, because I realized
that I didn’t fully understand them. I had to think deeply about each topic to come up
with simple, clear language to explain complex elements. In other words, I had to really
ensure that I understood each topic before I could write about it. This process has made
me a better teacher and a better practitioner. Because teaching is my priority, I really
hope that this book will reach folks who may feel intimidated by Power BI. I hope it will
empower you, dear reader, to tackle the PL-300 exam. Even more importantly, I hope the
book will encourage you to pick up other books written by other Power BI professionals.
Apress publishes many of these titles, and they are all excellent.
Finally, let me share with you my personal mantra: #showup. Do not be afraid to take
the exam; so what if you fail? Failure is integral to learning. Do not be afraid to speak
at a conference; there are always folks who know less than you do and folks who know
more than you do. Do not be afraid to become active in the Power BI community. We
are a very welcoming, inclusive group of people who want everyone to succeed, and that
includes you!
xxiii
PART I
Prepare to Study
CHAPTER 1
Exam Overview
Welcome, reader. I hope that this book will be informative and helpful as you prepare
for the PL-300 exam. I am a big believer in certification and want to encourage as many
people as possible to get certified.
Why Certify?
The very premise of this book begs a question: Why certify? Lots of very talented
professionals in the Power BI community are not, and don’t feel the need to be, certified.
You certainly can go this route if your “street cred” is high, that is, other professionals
recognize your expertise. Building up your reputation over time is one way to accomplish
professional recognition. But what if you are in a hurry? Or you don’t have an extensive
network to leverage? This is where a certification is valuable.
Any Microsoft certification test you take is rigorous and comprehensive—it is
supposed to be! If you pass, that is a very good indicator to others (hiring managers,
colleagues, your wider network) that you possess the minimum amount of expertise
deemed necessary to be a competent Power BI practitioner. The PL-300 exam is
what I call a “broad-spectrum” exam; it will test you on a wide range of concepts and
techniques. To prepare for the exam, you need to make sure you are conversant with
the full Power BI ecosystem. That’s what makes the PL-300 (and the DA-100 before
it) such a good indicator of your competencies and why certification is a great way to
advertise them.
terrified of taking a test. In my observation, there are two types of exam takers: (1) those
who want to be completely prepared and won’t sit for an exam unless they are close to
100% confident in their knowledge and (2) those who take the exam as soon as they feel
even slightly ready. (Full disclosure: I am firmly in the second camp.) If you are in the
“completely prepared” camp, you are your own best judge of when to take the exam.
But I can say don’t wait for the perfect moment. No such moment exists. I can’t honestly
say that this book (or any study material) will completely prepare you for every question
on the exam. There will be questions even a seasoned professional may not have
encountered. Nor do I expect that you will want to take exams the way I do: on a wing
and a prayer. I use exams as a gauge of how far I am from competency. Occasionally,
my approach works, and I unexpectedly pass an exam. But more frequently, I fail. I
have a high tolerance for failure, which is not the same as saying it doesn’t bother me. It
does. But I work at taking it in stride. I respond to passing the same way I react to failing;
it’s a milestone along the way. In this way, I normalize the taking of exams, without
overvaluing either outcome. In this book though, I am trying to prepare you for a middle
way: taking the exam once you are reasonably confident in your knowledge.
4
Chapter 1 Exam Overview
Signing Up
The first step to taking the exam is signing up. You do this on the Microsoft website:
https://docs.microsoft.com/en-us/learn/certifications/exams/pl-300
The retail price for the exam is 165 USD. (You might have discounts based on your
workplace or other memberships.)
Once you choose “Schedule exam,” you will need to create a certification profile if
you haven’t taken an exam before. If you have taken an exam before, you will be taken to
your profile page.
You will need to provide a copy of valid identification when taking the exam. Here
are the acceptable forms of ID, taken from the Pearson VUE website:
• Passport
• Driver’s license
Unacceptable forms of identification include renewal forms with expired IDs and
government-issued name change documents with government IDs. If your identification
is not considered valid, you will not be permitted to complete your exam, and you are
unlikely to receive a refund.
Tip 1 If you are creating a profile for the first time, make sure that the name that
you provide matches the name on your identification you will use to validate your
identity. If it doesn’t, you may be challenged during your sign-in process.
5
Chapter 1 Exam Overview
Tip 2 Use an email address you will continue to have access to even if you
change employers. Use a Microsoft email address for best results: Hotmail,
Outlook, or your own domain.
After creating or verifying your profile, you will then be taken to the “Exam
Discounts” page. If you have received a discount code, this is where you will be able to
enter it.
Now proceed to the scheduling page.
1. Are there testing centers near you? A lot of them closed during the
COVID pandemic and may not have reopened.
6
Chapter 1 Exam Overview
I have switched to online testing. Here are some things I have experienced or done
that have worked well for me (or not!):
4. I had a Dell laptop in which the camera was on the bottom of the
screen. This created an awkward angle, which the proctor was not
used to. She constantly asked me to adjust my camera, something
that was not easy based on its position. I would recommend using
a free-standing camera if you can, as it will be easy to adjust on
request.
5. Proctors do not like it if you cover your mouth with your hand. Be
aware of your habitual gestures because the proctor may object.
6. Proctors do not like it if you read the question to yourself, even
silently. If that is a habit you have while reading, be aware of it.
7
Chapter 1 Exam Overview
These are just tidbits from my experience. Please read the Pearson VUE website
carefully, particularly if this is your first exam.
8
Chapter 1 Exam Overview
I haven’t taken an onsite exam since the beginning of COVID, so I can’t speak to the
rescheduling or cancellation policies of an onsite testing center. If you choose to take
the test at an onsite center, be sure to read the guidance documents carefully.
9
Chapter 1 Exam Overview
My advice for Fill in the Blank: Look for the parts of the answer about which you are
confident and fill in that blank. Then look at the other options and eliminate anything
that is clearly wrong. After that, it is something of a guess. I do mark these questions
for review because after finishing all the questions, I feel more confident in some of my
answers.
Problem/Solution: These questions pose a particular problem and then provide
a proposed solution. You are then asked if the proposed solution will solve the stated
problem.
My advice for Problem/Solution: Read the problem statement carefully. (I know I am
repeating myself, but I cannot overemphasize this enough. Sometimes there is a clue in
the wording of the problem.) As you review the proposed solution, remember that there
can be multiple solutions to a problem. Just because you marked a previous answer as a
solution does not mean the next question is not a solution. Don’t try to outwit the exam
algorithm—there is not a predetermined set of solutions that always obtains. Read each
proposed solution at face value.
1. Don’t be afraid to fail. Failing a test does not mean you are a
failure. Rather, it is a gauge that tells you that more study is
needed. As I said earlier, I have failed plenty of exams!
2. Get a good night’s sleep. You are taking an exam, not facing a
judge and jury.
3. Do not eat or drink anything unusual the night before your exam.
You can step away for an unscheduled break, but this is a recent
development, so I can’t give you any specifics.
6. Plan to keep your face in the camera’s view and your hands resting
on the table/desk or lap when you aren’t using your mouse/
touchpad. Proctors do not like it when you cover your mouth in
any way.
7. Manage your exam clock. Don’t spend too much time on one
question. If I can’t answer the question completely or confidently
within two minutes, I answer to my best ability and then mark it
for review. I rarely leave an answer completely blank. You would
be surprised how much your nerves have settled toward the end
of the exam. You can look at questions you weren’t sure of and
answer them confidently when you are reviewing them.
11
Chapter 1 Exam Overview
12
CHAPTER 2
PL-300 Coverage
As I mentioned in Chapter 1, I consider the PL-300 exam a “broad-spectrum” exam.
That means that the domains covered are comprehensive: from the Power Query Editor
(PQE) to the Power BI Desktop and then the Power BI Service. Before we dive into each
of these domains in turn (in subsequent chapters), I would like to provide an overview of
the Power BI ecosystem. I start all my training classes with this overview, and invariably
there are elements that surprise students.
The Tools
There are three separate tool sets that are used in Power BI: the Power Query Editor, the
Power BI Desktop, and the Power BI Service. You will need to be familiar with each of
these tools and what their individual roles are in the product.
Power BI Desktop
The Power BI Desktop (hereafter called “Desktop”) is the client where you will develop
your data model and create reports. It is a free tool, which can be downloaded from the
Microsoft Store. (See below for more information on downloading the Desktop.) You can
use the Power BI Desktop without logging into the Power BI Service, but if you want to
publish a report, you need to sign in.
13
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2_2
Chapter 2 PL-300 Coverage
Tip If you have Office 365 through your employer, your Power BI license will
probably be connected to those credentials. If you are learning Power BI proactively
and do not have employer-provided credentials (yet), you can sign up for a free
Power BI license. However, to do so you must use a “business” domain. For
example, you cannot sign up for a Power BI license using a Gmail email account.
Desktop Updates
The Power BI team at Microsoft delivers updates to the Power BI Desktop ten times a
year. The easiest way to ensure that you have the latest Power BI Desktop is to download
the application from the Microsoft Store. (Scroll down to the bottom of the web page to
find the download button.) If your organization does not allow you to download from the
MS Store, you can download the Desktop application directly from here. If you cannot
download from the MS Store, you will need to manually update the Power BI Desktop.
14
Chapter 2 PL-300 Coverage
Extract, Transform, Load (ETL) describes the process in which you will connect to a
data source, acquire the data you want (Extract), perform the changes you need to
make (Transform), and then apply the changes you have specified to the selected
data and import it into the Power BI Desktop (Load).
The Power Query Editor is a tool that is available through the Power BI Desktop.
It is also available through Excel 2016 (or later) and from the Power BI Service. Any
techniques and skills you use in the Power Query Editor within the Power BI Desktop
you can also use in the Power Query Editor in Excel or in the Service. Just a quick note,
new features are released to the Power Query Editor in this order: PQE Service, PQE
Desktop, and, finally, PQE Excel. There may be features that you use in the PQE Service
or in the PQE Desktop that you won’t see in PQE Excel.
15
Chapter 2 PL-300 Coverage
2. From within Office 365, click the tile for Power BI. You may have to
go to All apps to surface the tile if you have never used it.
3. From within the Desktop, after you have published your report,
follow the hyperlink to the Service.
The Service has three main areas: My workspace, Workspaces, and Apps. For this
exam, it is essential to have familiarity with Workspaces. If you are using a free Power
BI account, you will not have access to Workspaces, only to My workspace. Practicing
only with My workspace will not provide access to the full capabilities of the Service,
which is why you should sign up for the 60-day trial Power BI Pro license as you study for
the exam.
• Member: Can create, edit, and delete content. Can add other
members. Can decide what is included in the workspace’s app (if
there is one)
16
Chapter 2 PL-300 Coverage
You will not see a specific workspace in the Service unless you have been added to it
at one of the preceding levels of membership.
My workspace is a sandbox area where you can publish reports and experiment with
the features of the Service. You should not publish content to My workspace that you
wish to share with others.
An app is a vehicle for the distribution of reports and dashboards within the Power
BI Service. It is not the same thing as the Power BI mobile app. I think of the app as a
magazine that has curated content and is distributed at intervals (weekly, monthly,
quarterly). An app is associated with a specific workspace on a one-to-one basis (one
app, one Workspace). Someone with the right privileges in the workspace must create
and update the app. Apps can contain reports, dashboards, and Excel content. I will cover
Apps in more detail in a later chapter.
Licensing
You can use the suite of tools with a free license. However, you will be limited in your
capabilities using a free license: primarily you will not have access to Workspaces. To use
Power BI within a workplace infrastructure, you will need a Pro license, which can be a
trial license. If you want to work with the full Power BI ecosystem and you don’t already
have a paid license, you will need to sign up for a Power BI Pro trial license, which is
valid for 60 days.
Tip You can’t sign up for a trial license with a consumer email address such as
Gmail or Yahoo or AOL. You will need a “work”-related email to sign up.
Languages
There are two languages that are used with the Power BI ecosystem: M and DAX (Data
Analysis Expressions). You do not need to be an expert in either of these languages for
the exam. But you will need to be familiar with basic DAX and M functions and syntax.
We will cover the basics of the M language in Chapter 4 and DAX in Chapters 6 and 7.
17
Chapter 2 PL-300 Coverage
AdventureWorks Database
If you want a more robust (and realistic) set of data with which to practice, Microsoft
has developed several databases. AdventureWorks DW is the most commonly used, but
there are others, such as Tailwind Toys.
AdventureWorks is available as a BAK file, which you can use to restore a database
to your local device. This process was unfamiliar to me as I had no database background
(and still don’t); I assume it will be unfamiliar to many of you as well. I am going to
outline the steps you will need to take to use the database so you understand the overall
process. I will then provide a link to the Microsoft documentation where they give
step-by-step instructions.
Step 1: Download the BAK file for AdventureWorks DW. Find the BAK file for
AdventureWorks here.
Step 2: Install SQL Server Management Studio (SSMS). This is a free application
(there are paid versions, but you don’t need one) available here.
18
Chapter 2 PL-300 Coverage
Step 3: Install Microsoft SQL Server on your local device. This is where the
AdventureWorks database will be hosted.
Alternate Step 3: Set up an Azure AD account and use the Azure SQL Server option.
Note that you will need an Internet connection to access a database hosted in Azure.
Read all the fine print if you choose this option so that you aren’t surprised by any charges.
Step 4: Use SSMS to restore the database from the BAK file. There are detailed
instructions on how to do this at the following URL:
https://docs.microsoft.com/en-us/sql/samples/adventureworks-install-
configure?view=sql-server-ver15&tabs=ssms#restore-to-sql-server
Step 5: Use the credentials that you set up for the database to connect from the Power
BI Desktop. Take care to note if you are going to use database credentials or Windows
credentials to connect to your database.
19
PART II
• Excel/CSV
• Power Platform
• Azure
23
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2_3
Chapter 3 Get Data from Different Sources
Figure 3-1. The Home tab has several options for extracting data
After initiating the extraction, you will be presented with the Navigator dialogue
box, as shown in Figure 3-2. This dialogue box is where you can make further selections
in your data source. For example, if you are connecting to an Excel workbook, you will
see a list of worksheets and table objects in that workbook, as shown in Figure 3-2.
24
Chapter 3 Get Data from Different Sources
As shown in Figure 3-2, it is tempting to choose the Load button (because it looks
like you should). But unless your data is clean and ready to work with, choose Transform
Data instead because it will open the Power Query Editor window.
Tip In the Navigator window, you will see three yellow dots that scroll across
the top of the window. Do not be misled—they are not indicative that you must
complete another step.
25
Chapter 3 Get Data from Different Sources
Figure 3-3. Accessing the Data source settings in the Power Query Editor
26
Chapter 3 Get Data from Different Sources
To change the pathway, you can use the Go To Error button, which selects the
Source step and offers you an Edit Settings option, which you can see in Figure 3-5.
You will then be presented with a dialogue box, as shown in Figure 3-6.
27
Chapter 3 Get Data from Different Sources
This is one of the most common errors you can incur in the Power Query Editor. In
Chapter 4, we will cover errors in more depth.
Editing Permissions
If you are connecting to a data source such as SQL Server, you will have to enter the
credentials that enable you to access that source. If you need to change these credentials
(e.g., your password changes), you can do so in the Data source settings ➤ Edit
Permissions dialogue box, as shown in Figure 3-7.
28
Chapter 3 Get Data from Different Sources
Once you have identified the source you want to change, choose Edit Permissions,
as shown in Figure 3-8.
Finally, you arrive at the dialogue box shown in Figure 3-9, where you can choose
between three types of credentials: Windows, database, and Microsoft.
29
Chapter 3 Get Data from Different Sources
The type of credentials you will need depends on how the database administrator
has set up your account.
Clear Permissions
If you need to remove and/or replace existing permissions that you used to connect to a
data source, follow the same process as editing permissions. (See Figure 3-7.)
Privacy Levels
To control the potential leakage of your data, you can control the privacy levels of the
data in the Power Query Editor. If you are only working with data from within your
organization, you probably don’t need to worry about setting the privacy levels for your
data. However, it is important to understand what the options are both for the PL-300
and if you need to use them in your practice:
30
Chapter 3 Get Data from Different Sources
You can access the Privacy Level in the Edit Permissions dialogue box as shown
in Figure 3-10.
The challenge with setting privacy levels is that you can set them too rigorously.
If you do so, you can incur a Formula.Firewall error in your query. Another concern
with privacy levels is that they can slow down a refresh once your report is published
31
Chapter 3 Get Data from Different Sources
in the Service. There is an option to disable the privacy levels in the File ➤ Options
and settings ➤ Options ➤ Global ➤ Privacy menu. If you do choose to disable
the privacy levels, you must be sure that you are only working with data within your
organization’s control.
Import
The default storage mode is Import. In this mode, Power BI extracts a copy of the
selected tables (or views) and stores them in the Analysis Services database that is
spun up when you create a PBIX file. Import does not affect the source of the data—
you are not “writing back” to the source in any way. Import is a copy of the data at the
time of extraction. Contrary to your initial assumption, you do not need to work with
a constantly refreshed copy of the data to build your report. If the data that you are
working with is representative of the latest data, that is sufficient.
What does it mean for data to be representative? It does not mean that the values are
the same or the most recent. It means that the structure of the data remains consistent as
data is added, updated, or deleted.
Using the Import mode is a much more efficient way to process your queries: your
report will be more responsive. You will also have full control over the data model—you
can add measures, create the tables you need, and structure relationships optimally.
Direct Query
When I teach a class on Power BI and Direct Query comes up, invariably a student says,
“You should always use Direct Query so you can have the latest data.” Not to put too fine
a point on it, this is not necessary. It is true that if you use Direct Query you will always
be using the latest data. But you will pay a performance price for that timeliness. And you
don’t usually need to work with the most recent data. If the data you are working with is
representative (see earlier) of all the data, working with older data is not an issue.
32
Chapter 3 Get Data from Different Sources
Direct Query creates a connection between the Power BI Desktop and the data
source. Your report’s responsiveness will be dependent on the latency of this connection,
something that is probably not in your control but can negatively affect your report
performance. You will not be able to perform any transformations or modeling of
the data—you must use the data as is. If the data has been fully prepped for all your
reporting requirements, this restriction may not be an issue. But you need to be sure that
it meets your needs. Using Direct Query can also have a negative impact on the server
that you are connecting to; be sure to talk to the database and/or server owner to make
sure that your report doesn’t create an inordinate burden.
Before you choose Direct Query as your storage mode, fully investigate whether the
data really needs to be up-to-the-minute. Here are some questions you can ask yourself
or your report consumers:
1. How often will the report consumers act on the data? If the data
is only actioned once a day, or even twice a day, you don’t need
Direct Query.
3. Does the data change significantly in real time? How often is the
data refreshed at the source?
4. Are parts of the source data refreshed at different rates? If yes, you don’t
want to use Direct Query because parts of your report could conflict.
Don’t choose Direct Query unless you have some overriding business justification
for it; the disadvantages often outweigh any advantages.
Live Connection
When you connect to an Analysis Services source, it is called a Live Connection. These
three sources are SQL Server Analysis Services Tabular, SQL Server Analysis Services
Multidimensional, and Power BI Service dataset.
34
Chapter 3 Get Data from Different Sources
And of course, there are always good old Excel and CSV files. But there is a whole
new world of data sources that you have (potentially) available to you. (Whether you
have them available to you or not, you need to know about them for the exam.)
Dataverse
Dataverse is the new name for what used to be called the “Common Data Service.”
Approximately five years ago (don’t quote me on the exact date), Microsoft realized
that within their Dynamics CRM tool, they were sitting on a gold mine: a ready-made
database infrastructure that could be used by non-database-literate folks (like me)
35
Chapter 3 Get Data from Different Sources
to build a database. There are premade tables in Dataverse for commonly used data
structures, such as accounts, contacts, and so on. It’s a database in a box. And even
better, Dataverse is part of the Open Data Initiative, something that Microsoft, SAP, and
Adobe have collaborated to create. You can also use Dataverse to build your own tables,
if you can’t find one that works for you in the premade ones.
Dataverse is the data infrastructure that underpins the entire Power Platform, so
it should not be a surprise that Power BI can connect to a Dataverse model. Dataverse
tables are housed in something called an environment, and you need to have the URL to
connect to an instance of it. That URL will usually contain some reference to “CRM” and/
or “Dynamics.” (Remember, Dataverse emerged from Dynamics CRM.)
Dataflows
A dataflow is a set of data on which someone has performed transformations and saved
that work.
Imagine you have a colleague who is quite skilled with the Power Query Editor. This
person could perform transformations on a variety of data and then share the completed
work as a dataflow. Another use case: Often multiple report creators have the need
to connect to the same underlying data source, but for some reason, they should not
connect directly to the data source. A dataflow can be created that provides the content
(tables, views) that the report creators need.
To use a dataflow, you will need to have permissions for it (which we cover in a
later chapter). Once you have the appropriate permissions, connecting to a dataflow
is not substantively different from connecting from any other data source, as shown in
Figure 3-12.
36
Chapter 3 Get Data from Different Sources
Shared Dataset
If someone in your organization has already put a lot of work into creating a dataset,
anyone who has permissions to that dataset can use it to create a new report. We will talk
further in a later chapter about datasets, but the benefit of using a shared dataset is the
time savings. Someone else can do all the work of transforming and modeling the data,
and you can use it all in a report. Just a side note: Using a shared dataset creates a Live
Connection (see earlier).
37
Chapter 3 Get Data from Different Sources
Local Dataset
A local dataset is one sitting on your computer. There isn’t anything unusual about
connecting to a local dataset except when you try to set up the refresh schedule for the
local dataset in the Power BI Service. The Service will not be able to “reach” this dataset
without a gateway, which will be covered in a later chapter.
That list will be your query. There is a hyperlink where you can expand the actual
dataset for each item in the list. If your organization puts files that are related to one
another in the same folder (e.g., monthly budget Excel workbooks), connecting to
the folder is far more efficient than connecting to each workbook singly. You can also
combine the individual files together as a single query, as shown in Figure 3-14.
38
Chapter 3 Get Data from Different Sources
Tip You usually combine files that have the same structure: number of columns,
names of columns. If you combine queries with different structures, there may be a
lot of “messy” transformations to perform.
SharePoint folders work the same way, but there is one trick: you need the top-level
URL to the SharePoint. Nothing else will work.
Parameters
A parameter is one of the terms that stumped me when I began to learn Power BI. I
understood a parameter as a boundary or a limit. But within Power BI, it follows another
definition: an arbitrary constant or an independent variable. (All three definitions
courtesy of Merriam-Webster Dictionary.) A parameter does one of three things within
Power BI:
For the PL-300 exam, you will be expected to know how to change the value of a
parameter, but I want you to understand what a parameter is, where you create them,
and some of the ways you can use them.
39
Chapter 3 Get Data from Different Sources
Tip This is one of the few features where I do show how to create/use it because
parameters can be a little confusing when you are first getting started.
Defining Parameters
All parameters need to be defined in the Power Query Editor; they are part of data
preparation. To define a parameter, follow this list of steps:
Step 1: Select Manage Parameters.
Step 2: Select New Parameter.
Step 3: Populate the New Parameter dialogue box as shown in Figure 3-15.
Step 4: Provide a name and a description for your parameter. Use a name that
is unique.
Step 5: Specify the data type for the value that will be supplied to the parameter
(e.g., if you are going to enter dates, specify the Date data type).
40
Chapter 3 Get Data from Different Sources
Step 6: If there is only going to be a restricted list of possible values, you can provide
these values in a list you create or use an existing query that has all the values already in
it. If you want to use an existing column in an existing query, select that column, right-
click, and choose Add as a new query. This will create a new query that is a list (a single
column) that you can then provide as an input to the parameter as shown in Figure 3-16.
Step 7: Provide a default value for the parameter. This will be the value that displays
when a user first opens the parameter. You can enter a helpful message such as “Enter a
date here” or choose a default value.
Tip If you have ever used the Data Validation feature in Excel, this process
will be very familiar. The only feature this dialogue box doesn’t offer is the ability to
add a message.
41
Chapter 3 Get Data from Different Sources
42
Chapter 3 Get Data from Different Sources
Once you set up the list of values, you can then change the parameter value as shown
in Figure 3-18.
Figure 3-18. Changing the parameter value in the Power Query Editor
43
Chapter 3 Get Data from Different Sources
When you have enabled the load, the next time you choose Apply (or Close and
Apply), the parameter will appear in your data model in the Power BI Desktop. To
access the parameter, navigate to Transform data ➤ Edit parameters, and select the
appropriate parameter as shown in Figures 3-20 and 3-21.
Figure 3-20. Accessing the parameters created in the Power Query Editor
44
Chapter 3 Get Data from Different Sources
45
CHAPTER 4
47
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2_4
Chapter 4 Clean, Transform, and Load the Data
I think the Power Query Editor is the best tool Microsoft has ever created! And you
can use it through the Power BI Desktop, through Excel, or through the Power BI Service.
The Power Query Editor is not a standalone application; it must be accessed through the
Power BI Desktop or Service or through Excel. You can open it in one of two ways:
Figure 4-1. Accessing the Power Query Editor using Transform data
The PQE allows you to take the raw data (in the form of queries) and work with it to
perform all the changes you need to make it work for you. What kinds of changes?
This is not a comprehensive list of all the types of changes (called transformations)
you can perform, but to pass the PL-300 exam, you should be conversant with all the
preceding transformations.
48
Chapter 4 Clean, Transform, and Load the Data
You use the ribbon tools to specify the transformations you want to perform
for each query. Your mouse clicks are captured and recorded in individual steps,
called Applied Steps. (If you are familiar with macros in Excel, this process will sound
familiar.) Each step is “translated” into M and is visible using the Formula Bar
(see Figure 4-6 for an example).
To become a very proficient “transformer” (sorry—couldn’t help myself!), you need to
be very familiar with the extensive available commands. You do not need to know how to
write M from scratch, but some basic M skills are helpful on the exam (and in real life!).
Tip Turn on the Formula Bar under the View tab. Leave it on because it is the
fastest way to absorb M while going about your transformations. Each action you
perform using the ribbon is recorded in M and is visible in the Formula Bar, as
you can see in Figure 4-2.
Let’s examine an M statement, using a simple example shown in Figures 4-3 , 4-4,
and 4-5. I am going to split a column into two columns.
49
Chapter 4 Clean, Transform, and Load the Data
50
Chapter 4 Clean, Transform, and Load the Data
51
Chapter 4 Clean, Transform, and Load the Data
Now that we have the example set up, let’s look at the M that was generated by this
transformation, shown in Figure 4-6.
52
Chapter 4 Clean, Transform, and Load the Data
The M Language
You don’t have to be able to write M from scratch, but knowing some basic facts about M
is helpful:
6. To see the entire script you have written in the query you are
working on, open the Advanced Editor on the Home tab.
Tip Get in the habit of always putting your table name in single quotes—then,
when a table name requires single quotes, you won’t be wondering what is wrong.
If there is a naming convention in your organization, follow it. If there isn’t a naming
convention, establish one. Column and query names will be consistent.
Rename all your columns in the query as one Applied Step. That way, when you
look for the step where you renamed a column(s), it will be in one step. It doesn’t matter
if you do it at the beginning or end of your process, but because you may be creating and
deleting columns, you may want to save it until close to the end.
You can also rename individual steps, something I advise. Sometimes the Applied
Steps list is quite long—it will be much easier to find a particular step if it is descriptively
named. You can name a step by right-clicking it and choosing Rename. The one type
of step I always rename is one in which I have filtered out some data. That way, when
I panic, I can easily find that step and undo or redo it, as shown in Figures 4-8, 4-9,
and 4-10.
54
Chapter 4 Clean, Transform, and Load the Data
55
Chapter 4 Clean, Transform, and Load the Data
56
Chapter 4 Clean, Transform, and Load the Data
While you are naming things, it is a good time to document your query and your
steps. On the Applied Steps panel (on the right of the Power Query Editor window),
there is a hyperlink label All Properties. Click the hyperlink and enter a description
of the query as shown in Figure 4-11. Bonus: When you bring the query over into the
Desktop, the description will appear in the tooltip for the table!
Even more importantly, you can document a particular step as shown in Figure 4-12.
Right-click the step and choose Properties. Enter a description of what you did
and why.
Bonus: If you add a description to a step, a little circle with an “i” in it appears next to
it in your Applied Steps list.
Tip I always document steps when I filter data, remove columns, or make other
changes that may not be obvious to me or a colleague after some time has passed.
Tip Any documentation you add will be visible once you have applied your
changes (see “Loading Your Queries (or Not)” below).
58
Chapter 4 Clean, Transform, and Load the Data
Column quality
Column distribution
Column profile
Each of these features will introduce new elements to your screen real estate, so you
may not want these features on all the time. Looking at them when you first bring in the
data is a good practice; then you can turn them off after you have assessed your data.
Here are some suggestions for things to look for in these boxes:
59
Chapter 4 Clean, Transform, and Load the Data
60
Chapter 4 Clean, Transform, and Load the Data
Once you have scanned your data and noted any “problem” areas, you can return
to the View tab and turn off the Data Preview tools. You will always have the Profile
shortcut bar visible, right under the column headers as shown in Figure 4-16.
61
Chapter 4 Clean, Transform, and Load the Data
62
Chapter 4 Clean, Transform, and Load the Data
If you have two columns with a 1/1 ratio, scrutinize each of them to see which you
should keep. A key column has (by definition) high cardinality, which means it will be
very “expensive” to “store.” I hate to keep putting you off, but we will get to cardinality.
(It gets its own section!)
When a key column is present in another table, it is called a “foreign key.” When it is
in its own “home” table, it is called a “primary key.” You may not see these terms directly
on the exam, but the concepts they represent are critical. You can connect two tables
together by matching the primary and foreign key columns. If we were working in a
database, we would call this process “joining.” In Power BI, the term “join” is not used;
rather, we create “relationships.” You need to have relationships between tables for the
data model to work. (See Chapter 5.)
63
Chapter 4 Clean, Transform, and Load the Data
As part of your transformation process, you must ensure that each query has a
column that serves as the “key.” Simplify this column as much as you can. For example,
if the ID has two components (1234-56789) and only one of the components can serve as
an ID, split the column and reduce the key down to the minimum number of characters
to uniquely identify each row.
For Future Reference: Native and Surrogate Keys
A native key is something that the business (or the data owner) uses to uniquely
identify a data point, for example, employee ID for employees.
A surrogate key is a unique ID that is added to the data by a database owner. The
advantage of a surrogate key is that it is independent of the business, so does not
change, even if the business changes its methodology for identification.
For example, the HR department assigns an employee the ID number XYZ123. The
database administrator assigns the same employee the ID number 123456. Both
IDs are unique, but the ID 123456 is the surrogate key and never changes even if
the HR department changes their ID taxonomy to 123XYZ.
Once you have accessed Using Locale, set the data type as normal, as
shown in Figure 4-19.
65
Chapter 4 Clean, Transform, and Load the Data
7. If you can avoid storing a value as a Text value, do so. String (text)
values are the most “expensive” way to store values.
A colleague told me he once saved 30% in his overall data model size by changing
a column from the text data type to the whole number data type. Indeed, data
types matter!
66
Chapter 4 Clean, Transform, and Load the Data
Be deliberate and intentional in your data type choices. Checking the data types
should be the last thing you do before you finish your query transformations. Watch out
for extra Changed Type steps. You are usually safe removing these as they appear in your
list of steps. Most of the time they are unnecessary. (There are always exceptions. If the
Changed Type is necessary to perform a step below it, do not delete it. You will break the
subsequent steps.)
Tip Practice the same good habits regardless of whether the query type supports
folding. Then you won’t accidently break folding when it is available because of
sloppy practices.
How do you know if query folding is happening (or not)? On your Applied Steps
panel, select a step and right-click. If the View Native Query is grayed out, then query
folding is not happening. In Figure 4-20, query folding is happening.
67
Chapter 4 Clean, Transform, and Load the Data
If you think it should be, go back up your list of steps until you find the step where
it was broken. (Remember, it will never work with Excel, CSV, or PDF.) If View Native
Query is an active option, click it. A window will then open in which you can see the M
translated into the “native” language of the source server as shown in Figure 4-21.
One final note: Query folding is probably not going to show up on the PL-300, but
while I want to help you pass the exam, I also want you to become a skilled Power BI
practitioner. Knowing how to use query folding to speed up your transformations is
one skill that you should have.
Your Chance to Practice
Replacing Data
Blanks and Nulls
The Power Query Editor treats Null and Blank values differently. For both values, you
use the same technique to replace them: Replace Values as shown in Figures 4-22
and 4-23.
69
Chapter 4 Clean, Transform, and Load the Data
70
Chapter 4 Clean, Transform, and Load the Data
Errors
Errors are a little trickier. If you are lucky enough to have all the errors show up in the first
1000 rows, you can review them and determine the issue. You can see the error source by
clicking the cell with the error, as shown in Figure 4-24.
You can also click the hyperlink for the error. This will result in a new step being
added, which may not be necessary for diagnosis. If you right-click the Data Quality
peek bar, there is a contextual menu specifically for handling errors, as shown in
Figure 4-25.
71
Chapter 4 Clean, Transform, and Load the Data
You can remove or replace the errors from this menu. But what if you suspect that
you have errors in rows that are not included in the first 1000 rows? You can set the
Power Query Editor to profile all the rows of your data. There is a drop-down box on the
bottom left-hand side of the screen you can toggle, as shown in Figure 4-26.
72
Chapter 4 Clean, Transform, and Load the Data
Once the profiling behavior is changed, the Data Quality peek will reflect all the
rows. If there are errors, they will be highlighted under the Error category, shown in
Figure 4-27.
This example does not have errors, but if it did, they would be reflected in the Error
category in the Data Quality peek.
If the errors are not present in the first 1000 rows, how can you determine how to fix
them? Use the Keep Errors option in the Data Quality peek context menu, as shown
in Figure 4-28.
73
Chapter 4 Clean, Transform, and Load the Data
You will now have a query with just the errors, as you can see in Figure 4-29. (It might
be a good idea to duplicate the query first if you want to preserve the query in its original
state. Duplicating a query is discussed below.)
Now you can diagnose the errors and take the appropriate measures to fix them.
74
Chapter 4 Clean, Transform, and Load the Data
• Custom Column
• Conditional Column
• Index Column
• Duplicate Column
The correct option is the one that most efficiently performs the necessary task. For
example, if you want to add a new column with the country “United States,” you could
use either Column from Examples or Custom Column. Figures 4-30 and 4-31 show both
methods.
I have provided these two examples to illustrate that there will often be several
ways to perform the same task. Which method you choose will vary based on your
understanding of each technique and the requirements of your task.
76
Chapter 4 Clean, Transform, and Load the Data
Combining Queries
Append
Imagine a scenario in which you have 12 different Excel worksheets, each for a different
month in the year. You bring each of them into the PQE, and now you have 12 different
queries. You have a perfect opportunity to streamline the queries. You can choose
to append all of them into one new query (e.g., Append Queries as New) or append
them into an existing query (e.g., append February into the January query and so on).
In Figures 4-32, 4-33, and 4-34, there are four queries that will be combined into one
separate query. (In these examples I am using Append, but these remarks apply equally
to Merge.)
77
Chapter 4 Clean, Transform, and Load the Data
Merging
The mechanics of merging two queries are like those you use when appending, with
one key difference. When appending, it is a good idea to ensure that the structures of
both queries (number, name, data types of columns) are the same. With a merge, it is
important to understand exactly how you want to merge the two queries. There are
seven different join patterns, which I will explain in the following.
78
Chapter 4 Clean, Transform, and Load the Data
The default join is a left outer join (Figure 4-35). In a left outer join, records in one
query are compared with records in a second query. Because a picture can replace 1000
words, I am illustrating each type of join with a simple diagram.
Figure 4-35. Left outer join: all rows from the left, matching from the right
The next most common type of join is a right outer join. This is the inverse of a left
outer join (Figure 4-36).
Figure 4-36. Right outer join: All rows from the right, matching from the left
Next up is a full outer join (Figure 4-37). This type of join merges the two queries
regardless of matches.
79
Chapter 4 Clean, Transform, and Load the Data
Figure 4-37. Full outer join: all rows from both queries
The full outer join (Figure 4-38) is very effective for identifying where two queries
do not match up. The direct opposite of the full outer join is the inner join.
Figure 4-38. Inner join: only rows that are present in both queries
By now you have probably figured out what is next: the left anti join
(Figure 4-39).
80
Chapter 4 Clean, Transform, and Load the Data
Figure 4-39. Left anti join: only rows in Query A that are not matched
Figure 4-40. Right anti join: only rows in Query B that are not matched
Figure 4-41. Full anti join: only rows in both queries that are not matched
81
Chapter 4 Clean, Transform, and Load the Data
Duplicating a query
In the preceding example, one option you have is to duplicate one of the queries and
then append all the other queries into the duplicate. When you duplicate a query, you
are making an exact copy, shown in Figure 4-42. There are other times when duplicating
a query is helpful, for example, when you need to preserve the original query as it is.
A Matter of Style
Lots of choices you make in the Power Query Editor are questions of style. When
appending files, I prefer to append (or merge) them all into one new query, leaving
the originals as is. But this isn’t a “must-do.” Experiment with different methods so
that you can choose the right one in each circumstance.
82
Chapter 4 Clean, Transform, and Load the Data
Referencing a Query
Now let’s think about it another way. What if the original query has many Applied Steps
(transformations) and you are still working on it, but you need to copy the query and
have it reflect all the work you are continuing to do on the original query? Reference the
original query as shown in Figure 4-43. It will create a second version of the query, but
any changes you make in the original query will cascade to the second version.
Deleting a Query
You can delete a query if you don’t need it as shown in Figure 4-44.
83
Chapter 4 Clean, Transform, and Load the Data
You can’t delete a query that is being used in another query (e.g., if you have
appended or merged it into another query).
84
Chapter 4 Clean, Transform, and Load the Data
85
Chapter 4 Clean, Transform, and Load the Data
Figure 4-45. Using the Filters panel to see all the unique values in a column
But there’s a hitch: the Filters panel cannot display more than 1000 unique values,
as you can see in Figure 4-46.
86
Chapter 4 Clean, Transform, and Load the Data
If you have more than 1000 unique values and you need to filter some out, you must
use the manual filters to create the filter you need as shown in Figure 4-47.
87
Chapter 4 Clean, Transform, and Load the Data
If you cannot filter without seeing all of the data, you can scroll through your data,
shown in Figure 4-48.
88
Chapter 4 Clean, Transform, and Load the Data
89
Chapter 4 Clean, Transform, and Load the Data
Figure 4-49. This step will remove a column called “Vendor Number”
Figure 4-50. This step will only keep the explicitly named columns
In Figure 4-49, one column has been excluded explicitly by using Remove Columns.
What happens if the next time the data is refreshed another column is added? Will the
new column appear in the report? In this example, the answer is yes because it has not
been specifically excluded.
In Figure 4-50, three columns have been specifically included using Select Columns.
What happens if the next time the data is refreshed another column has been added to
the data source? Will the new column appear in the report? The answer is, no, it will not
because it has not been specifically included.
There are many techniques to write M so that it is flexible and can handle changes
to the source data, almost all of which are beyond the scope of this book. But there are
several good books that have been published in which you learn how to future-proof
your queries, which I will list at the end of the chapter. For the PL-300, learn to recognize
an M expression that will break your query or perform unexpectedly. For real life,
invest some time in learning how to future-proof your queries—your future self, and
colleagues, will thank you.
90
Chapter 4 Clean, Transform, and Load the Data
Hopefully you won’t often see this many errors, but the resolution process is always
the same. Start with the step that has the error and then select each step preceding the
one with the error, until you find a step that isn’t broken. Then identify what happened
between the last working step and the first broken step.
The good news is that most errors are one of two types: a broken file path or a prior
step in the wrong sequence. I covered broken file paths in the previous chapter, so here
I will talk about a few common types of steps that break other steps. (I can’t cover every
possible error type.)
91
Chapter 4 Clean, Transform, and Load the Data
No matter the type of error, to troubleshoot I start at the broken step and then look
at each step above it in turn. In this case, I would find that the Renamed Columns step
caused the problem, and I can fix the error by deleting that step. Sometimes you must do
more radical surgery and rearrange or redo your steps.
92
Chapter 4 Clean, Transform, and Load the Data
While using the Advanced Editor is beyond the scope of the exam, I want you to
know what it can do for you. If you need to modify several steps and you feel confident in
your M coding skills, you can edit the M directly in the Advanced Editor. Additionally,
M steps that you see in the Advanced Editor can be copied as plain text and pasted into
another query.
When you first start editing M in the Advanced Editor, there are some common
pitfalls:
• Make sure that you have a comma after each step except the last one
(the one just above the in statement).
• Make sure that your M script starts with a let statement and ends
with an in statement (unless you are using functions).
• The in statement usually references the last step name.
• The Source step (the first one) must point to the right location for
your data source.
93
Chapter 4 Clean, Transform, and Load the Data
C
opying a Query
An even easier way to reuse the M script is to copy the query on the Queries panel. Select
the query on the Queries panel (on the left side of the PQE) and then Ctrl+C. Open the
PQE window for another PBIX file and Ctrl+V. The entire query is now available to the
second PBIX file.
94
Chapter 4 Clean, Transform, and Load the Data
Like all surgery, be careful when you do this. Here are some common “gotchas”:
Take your time and pay attention to the details. Don’t try to edit in a hurry; that is the
fastest way to break your M script.
95
Chapter 4 Clean, Transform, and Load the Data
96
Chapter 4 Clean, Transform, and Load the Data
5. Keep the Formula Bar open and read the M for each step.
A
dditional Resources
It is impossible to cover everything about the Power Query Editor in a single chapter.
With that in mind, I want to recommend a few books that can further your knowledge.
• Collect, Combine, and Transform Data Using Power Query in Excel
and Power BI by Gil Raviv
• Master Your Data with Excel and Power BI by Ken Puls and
Miguel Escobar
In Chapter 15, I will provide additional resources, including YouTube and other
Internet resources.
97
PART III
101
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2_5
Chapter 5 Design a Data Model
may come from a wide variety of different sources and may never have been combined
before. That’s part of the magic of Power BI!) Before we explore relationships, I need to
define some important terminology.
A fact table contains the data you are reporting on. In retail, Dimension (dim) tables describe the
it could be sales transactions. In medicine, it could be elements of your fact table in greater
appointments and/or outcomes. In manufacturing, it could be detail. A dim table usually has a lot
data from each production line. Fact tables record things that of columns (very wide), many of
have happened (usually), and so you will almost always see which are “strings” or alphanumeric.
a date (and maybe time) stamp as part of a fact table record.
In the dim table, the ID number
A fact table ideally only contains values that are in numeric
for the product (or customer or
format (quantity; date; time; price; unique IDs for customers,
patient) is a primary key. (See
patients, and products; etc.).
Chapter 4, “Keys and IDs,” for more
For example, if the fact table contains sales transactions, information.) In the dim table, the
each record will have an ID for the customer and for the record for that ID number is very
product. Ideally, this ID will be an integer (whole number). detailed: the customer’s name,
This ID is a foreign key that allows the fact table to be address, birth date, demographic
related to the dim table for the customer (or product). info, etc.
The fact table is usually the longest (the greatest number Dimension tables have just one row
of rows) of the tables in the model. There can be two fact for each element being described
tables in a model, but that is a more advanced modeling (customer, product, store, etc.).
problem, so I assume only one fact table in this book.
Models usually have multiple
Fact tables can have many rows for each element such as dimension tables. Ideally, dim tables
product or customer or store. connect directly to the fact table,
but they can be related to other
dimension tables.
A quick note about other types of tables: There can be other types of tables in a data model such as a
factless fact table or a bridge table. This book does not tackle those concepts, nor will the PL-300.
102
Chapter 5 Design a Data Model
• Fact table fields are the values that are analyzed in a visual (e.g.,
summarized, averaged, counted).
103
Chapter 5 Design a Data Model
In Figure 5-1, both the Product and the fact table have a field called ProductKey.
Because there is only one row for each product in the Product (dim) table and there are
multiple rows for each product in the Sales (fact) table, the relationship is one-to-many.
The one side of the relationship is indicated by a tiny 1. The many side of the relationship
is indicated by an asterisk, as shown in Figure 5-2.
104
Chapter 5 Design a Data Model
Tip If you can’t figure out which table is your fact table, look for the table that
has lots of rows with repeating customer IDs or product IDs or store IDs (the ID will
depend on what data you are reporting on). Each fact will usually have a date (and
maybe a time) associated with it.
Using the preceding example, if you choose a particular ProductKey in the Product
table, the relationship will convey that selection to the Sales table as outlined in
Figure 5-3. The Sales table is then filtered to only show facts related to the selected
product (or selected products).
Figure 5-3. Filter transmission from the Product to the Sales table
105
Chapter 5 Design a Data Model
Figure 5-4. A dimension table with multiple rows for each customer
How can you select the right rows in the dimension table? What is the difference
between each row listing Customer A in the dimension table? The multiple rows in
the fact table are to be expected; after all, you hope that there are multiple sales for
each customer. We can create a many-to-many relationship between these two tables
and then ask the engine to process through the records. Here’s the problem, and it is
a big one: You run the risk of duplicate counts or of records not being included. Either
way, your report will be inaccurate. If your tables contain millions of records, you are
not likely to spot the error. Your report will also be slow. If you must create a many-to-
many relationship, you can mitigate its potential ill effects by setting a filter direction
(see below). But your best course of action is to redesign your model before resorting
to a many-to-many relationship. Return to the Power Query Editor and simplify the
dimension table. How you do this will vary based on your data, but keep the goal in
mind: you want the dimension tables to contain one unique record for each element
described (customer, store, product, etc.). Usually, you must simplify the dimension
table (de-duplicate, add a field, etc.), which will result in the dimension table having a
unique record for each element. Apply your changes to the model and create a one-to-
many relationship.
106
Chapter 5 Design a Data Model
One-to-One (1-1)
The third type of relationship is a one-to-one relationship. A one-to-one relationship
is created between two tables when there is a unique row in both tables for a particular
customer (store, product, etc.). (Don’t confuse this with a fact table that currently only
has one row for a particular customer. In that case, the fact table can have multiple rows
for a customer. It just does not right now.) If Power BI suggests a one-to-one relationship,
this is an opportunity to simplify your data model, as shown in Figure 5-5.
Return to the Power Query Editor and combine the two tables (it will probably be a
merge operation). Apply your changes; you will only have one table and can proceed to
create the standard one-to-many relationship.
Unlike the many-to-many relationship, the one-to-one relationship doesn’t come
with any significant disadvantages. Notwithstanding, if Power BI suggests a one-to-one
relationship, you should try to merge the two tables to streamline your data model.
107
Chapter 5 Design a Data Model
Tip If you see repeating values in a visual, the first place to look is in your model.
There is a missing relationship or a problem with the existing relationship between
the two tables. Do not waste time trying to “fix” the visual—that is almost never
the problem.
Star Schema
As soon as you get started with Power BI, you will start reading and hearing about
star schemas. This term refers to the “shape” of your data model, but it is much more
metaphorical than physical. In a star schema, the fact table (usually just one) sits at the
“virtual” center of your tables. The dimension tables are arranged in a circle around the
fact table. Each dimension table is connected to the fact table through a relationship.
The star schema is not required. Rather, you should consider it the ideal that you
are striving toward as you create your model. There is a common variant called the
“snowflake” schema.
For Future Reference: Normalized Tables
108
Chapter 5 Design a Data Model
A normalized schema is one in which tables have been deconstructed into their
constituent parts. For example, if you have a Product table that has Subcategory
and Category information in it, in a normalized schema, this table is broken
down into three separate tables (or maybe even further). You will see this type of
schema referred to as Third Normal Form, and it is quite common in data modeling
generally.
Power BI aims for a happy medium. You don’t want to break down your tables
to their furthest extreme, but you also don’t want all your data in one table (as
in Excel).
Snowflake schemas are not the worst design for a data model, and sometimes they
are necessary. Remember, the star schema is your ideal data model structure.
Single-Direction Relationships
By default, when Power BI creates a 1-many relationship, the direction will be single,
flowing from the one side (usually the dim table) to the many side (usually the fact
table). Recall the example from earlier (Figure 5-6).
109
Chapter 5 Design a Data Model
This behavior enables you to make a selection in the dim table where there is only
one row for each customer (or product or store), thereby avoiding ambiguity in your
selection. This selection is then transmitted from the dim table to the fact table via the
direction of the relationship. As long as the direction is one way, you don’t have to worry
about incorrect results arising from a bidirectional relationship.
110
Chapter 5 Design a Data Model
Bidirectional Relationships
A bidirectional relationship is one in which a filter can be transmitted from either table
in the relationship. This may sound very convenient, and there will be times you will be
tempted to use a bidirectional relationship to solve a data modeling problem, as shown
in Figure 5-7. Avoid this if you can. Bidirectional relationships can introduce ambiguity
(or, worse, errors) in your reports. They can also slow your report down significantly.
With that warning out of the way, there are ways to mitigate the potential damage a
bidirectional relationship can do.
111
Chapter 5 Design a Data Model
Finally, Cardinality!
In the previous chapter, I mentioned cardinality, and I promised that I would go into
great depth explaining this very important concept. First, a formal definition: A column’s
cardinality is defined by how many unique (non-repeating) values it has. A column that
is a “key” column has, by its very nature, high cardinality. In contrast, a column that
has the same values repeated has lower cardinality. One of your primary jobs as a data
modeler is to reduce or eliminate high cardinality everywhere you can, because a column
with high cardinality is “expensive” to store.
For Future Reference: The VertiPaq Engine
The engine that powers Power BI is called “Vertipaq.” Vertipaq stores and accesses
data in columns (vertically), not horizontally. This method makes Vertipaq very
fast at retrieving data and performing computations. It uses several compression
algorithms, all of which are less effective the higher the number of unique values
in a column. Therefore, a column with high cardinality is “expensive” to store: the
engine cannot perform as much compression.
The best place to reduce cardinality is in the Power Query Editor. Can you eliminate
the column entirely (is it necessary for your reporting)? Can you split the column into
smaller units with more repeating values? For example, here’s a single column with
values separated by a pipe (|) symbol:
112
Chapter 5 Design a Data Model
Each of the columns, except the last one (with the “200”), would have much lower
cardinality than the original column. Another common opportunity to lower cardinality
is a date/time column:
4/15/2022 09:43 am
If you are using the time component, you can split the column into two (date and
time), each of which will have much lower cardinality than the original column:
4/15/2022 || 9:43 am
If you are not using the time component, change the contents to date only.
When you do have a column with high cardinality that you cannot simplify (e.g., a
key column), try to store that column as an integer, preferably a whole number. Integers
are easier to compress, so even if the column is “expensive,” you can mitigate the impact
by selecting the most efficient data type.
Selecting the data type for the column is best done in the Power Query Editor, but
you can change the data type in the Power BI Desktop if needed. There are a few other
things you can set for the column in the Desktop:
1. The format of the data: You are not changing the data type
(which is how the data is stored); rather, you are changing how
it is displayed in your report. The only place you can change the
format of the data type is in the Desktop; you cannot change the
data format in the Power Query Editor.
2. The categorization of the data: There are certain types of data that
benefit from being correctly categorized. The most frequently
categorized data is geographic data, shown in Figure 5-8. For
example, if you have a column with a city name and a column with
country names, both columns are text data types. By categorizing
columns—these respectively as “City” and “Country”—you can
ensure that they won’t be inaccurately mapped. (Cities and
countries can have the same name: Columbia, South Carolina,
and Columbia the country.)
113
Chapter 5 Design a Data Model
Figure 5-8. Categorizing data using the Column tools menu in the Report view
Tip This is a Microsoft tool, which means that there are almost always at least
two ways to perform a task. You can categorize data in the Model view as well, as
shown in Figure 5-9.
114
Chapter 5 Design a Data Model
1) The fact table may not have all the dates between the earliest and
latest dates represented. What if the company in question does
not accept orders, ship, or deliver on the weekends? (Improbable,
115
Chapter 5 Design a Data Model
I know, but work with me here.) The fact table will not contain
any rows for dates that fall on a Saturday or Sunday. What if the
company observes holidays that can fall on a weekday (Christmas,
New Year’s Day, Fourth of July)? None of these dates will be
represented in the fact table. These gaps in your data mean that
you will not be able to make accurate calculations of time elapsed
between an order date and a ship date (performed by a simple
subtraction of dates) or any other calculations involving dates.
By now you are wondering what to do to avoid all these dire circumstances, and well
you might! The answer is simple: add a dimension table specifically for dates. And the
good news is that it is (relatively) easy to do so. A date dimension table (often shortened
to “date dim”) can be constructed in one of three ways, all of which are equally effective.
Which one you should choose depends on your company’s particular data environment:
1. Use one that has been created by someone else and stored in a
data warehouse. If you are lucky enough to have one of these,
rejoice! All you do is to import that table the same way you would
any other table from a data source. The good news is that it will be
accurate, standardized, and complete.
116
Chapter 5 Design a Data Model
Tip If your company does not already have a corporate date table, make it your
mission to get one created and stored in an area where anyone using Power BI can
access it.
2. Create one in the Power Query Editor. This method has the
advantage of taking up less “space” in your model (more on that
in the next chapter). You can readily find the M code for date
tables that have been created by experts in M such as Ken Puls
and others. Or you can watch one of the several excellent YouTube
videos on the subject and create one yourself.
3. You can use DAX to create a date table in the Power BI Desktop. As
with the M code date tables, there are excellent examples readily
available on the Internet. Most would agree that the best examples
are those provided by SQLBI (I have no affiliation with them, just a
big fan). In the next chapter, wherein we explore DAX more fully, I
will return to using DAX for your date dimension table.
Whichever method you choose (or have available), you need a date table in your
model. Once the date dimension table has been created, there are several steps you must
take for it to be useful:
Best Practice In your sort column, include the year number and the month
number (e.g., 202101, 202102, 210203). That way, the months and years will be
sorted appropriately in your report.
2. Mark your date table. You will need to have one column that has a row for
every date between the earliest and the latest date present in your model.
This column must be formatted as a date. Once you have successfully
marked the date table, you see a little icon next to your date column that
looks something like an ID card as shown in Figures 5-10 and 5-11.
117
Chapter 5 Design a Data Model
118
Chapter 5 Design a Data Model
Figure 5-11. The date column indicates that the date table has been marked
Without a date table, Power BI creates mini date tables “behind” every date field in
your model; these tables are called “shadow” date tables, and they are problematic
for several reasons: 1) You have no control over them. You can’t add to or modify
them.2) They bloat the data model unnecessarily. 3) They don’t work reliably with
DAX time intelligence functions.There are several ways to get rid of them. The first
is to create a date table (using one of the methods listed earlier), mark it as a date
119
Chapter 5 Design a Data Model
table, and establish a relationship between the date dim table and the fact table.
Once you perform these three steps, the shadow date tables are expunged from
the data model for each table connected to the date dimension table. The second
way is to prevent them from being created at all, either for the current file or for
all of your PBIX files. You do this in the File ➤ Options and settings ➤
Options under Data Load, as shown in Figure 5-12.
120
Chapter 5 Design a Data Model
3. Connect the date dimension table to the fact table via a 1-many
relationship. (Remember, the date dim table is a dimension table
just like any other in your model. There is one row for each date
between the earliest and the latest date in your model.)
Now that I have covered the why and the how of creating a date dim table, we can
return to the first statement of this section: almost every data model will have multiple
fields that are dates. To use each date field in a report visual accurately, the field must
be connected to the date dimension table. But remember: there can only be one active
relationship between two tables, which leads us to inactive relationships.
Inactive Relationships
If you create a second relationship between two tables, the second one will automatically
be inactive. You can’t manually activate a relationship once the report is published,
which is why there is a DAX function called UseRelationship. I will address DAX
in Chapter 7, so don’t worry if you are not sure what a DAX function is. For now, the
important thing to know is that you can create as many inactive relationships as you
need between two tables. Returning to our example, you would create one active
relationship and two inactive relationships between the fact table and the date dim table
(as shown in Figure 5-13):
121
Chapter 5 Design a Data Model
Usually, the field that you use most in your reports is the one that has the active
relationship. In this example, the 'Orders'[OrderDate] field is the most used in reports,
which is why it is the active relationship. If 'Orders'[ShipDate] is more commonly
used in reports, then the active relationship could be between 'Orders'[ShipDate] and
'DateDim'[Date].
122
Chapter 5 Design a Data Model
Role-Playing Dimensions
There are scenarios in which you don’t want to use the imactive relationship technique.
Perhaps you can’t identify which date field will be used the most in reports. There is another
way to model the data so that you can use the OrderDate, ShipDate, and DeliveryDate
without having to activate a relationship: role-playing dimensions. In our example, you
would duplicate the DateDim table twice (so you have three total), and each DateDim table
would have an active relationship to the appropriate date field in the fact table:
Every table that you add increases the size of your model, so think carefully
before you choose role-playing instead of using active/inactive relationships. If your
model is small overall, then the penalty for the extra tables may not be important for
performance. But if your model is already complex, with lots of tables, opting for active/
inactive relationships is probably a better choice.
Critical to Success
Creating the correct relationships is critical to the success of your report. Without
the proper relationships, your visuals will be, at best, inaccurate. At worst, they will
be wrong. Relationships play an important role in the performance of your report. A
bidirectional relationship can slow your report significantly, among its other drawbacks.
There is a rule of thumb in the Power BI community that you will spend 80% of your
time cleaning, transforming, and modeling your data. If you find yourself wondering
when you can get to building a report, be patient! Once the model is complete, you will
be amazed at how fast the report comes together. In the meantime, let’s move to perhaps
(?) the most challenging part of modeling: writing DAX.
123
CHAPTER 6
• Calculated tables
• Calculated columns
• Measures
• Security roles
In this chapter we will cover calculated columns and tables and security roles in
some depth. We are saving measures, and a deeper examination of DAX, for Chapter 7.
Tip The Formula Bar isn’t visible unless you are creating something (table,
measure, column) using DAX or you select something that was created using
DAX. If you want the Formula Bar not to display, check the X. Don’t worry—you
won’t delete anything that has already been created.
Calculated Tables
The easiest way to add a table is to copy an existing one. The DAX syntax is simple.
For example, if you want to make a copy of an existing table, you could use this DAX
expression, as shown in Figure 6-1:
You can also construct new tables using more complex DAX. It is beyond the scope
of this book to provide detailed information about DAX functions. For the PL-300 exam,
there are two concepts to understand:
126
Chapter 6 Develop a Data Model
Avoid creating calculated tables if you can. Your best option is to create the needed
content (tables or columns) at the source. Because modifying the source is often
impossible, the next best option is to have tables and columns in the Power Query Editor.
127
Chapter 6 Develop a Data Model
Calculated Columns
Calculated columns present a temptation for newer Power BI practitioners, especially
those of us coming from Excel. Let’s stipulate that you need to perform a calculation not
present in your existing data; a common one is Total Sales. In Excel this is easily solved
by adding a formula in a new column that multiplies Unit Price by Quantity. Once over
in the Power BI Desktop, creating a column is our first instinct. There are times when
creating a calculated column is the correct option, but if so, you should create it in the
Power Query Editor if possible. (Even better, add it to the source of the data.) The reason
to avoid calculated columns is the same as it is for calculated tables: the impact on
performance and the static nature of the calculation. With this warning in mind, when
should you use a calculated column? In two specific circumstances:
128
Chapter 6 Develop a Data Model
If the calculation needs to be performed for each row for the total to be accurate, then
you should use a calculated column. In Figure 6-4 is a screenshot of the base columns in
the 'Orders Details' table.
Figure 6-4. The original columns in the query; none provide a total
Here are the DAX calculations to create the necessary columns such as subtotal
and total:
Subtotal=
'Orders Details'[UnitPrice]*'Orders Details'[Quantity]
Discountvalue =
'Orders Details'[Subtotal]*'Orders Details'[Discount]
LineTotal =
'Orders Details'[Subtotal]-'Orders Details'[Discountvalue]
129
Chapter 6 Develop a Data Model
Figure 6-5. Compare the DAX expressions to the results in the columns
1) They are written the same way you would write them in Excel.
When you create a calculated column, you are performing a specific calculation row
by row. This behavior is called “iterating.” A calculated column is an iterated calculation.
We will be getting deeper into DAX in Chapter 7, but it’s never too early to start
introducing key DAX concepts—here’s your first one:
130
Chapter 6 Develop a Data Model
DAX “thinks” primarily in columns. It can also “think” in rows, and when
it does, it is iterating over a table or a column.
(Yes, I am speaking as if DAX is a living breathing organism, which of course it is not.
But bear with my literary flights of fancy. Maybe once you have worked with DAX, you
too will think it has a mind of its own!)
Hierarchies
Many types of data lend themselves readily to hierarchies. Here are just a few examples
that come to mind:
You can use these individual fields without congregating them in a hierarchy, but if
you organize them into a hierarchy, you accomplish several things:
1. You make it clear to the user that the fields relate to each other in a
hierarchical structure.
2. You make it easy for the report creator (who might be you!) to drag
all the related fields on to a visual at once.
Hierarchies can be created either in the Report view or in the Model view. In the
following examples, I am using the Model view.
In Figure 6-6, there are several fields in the “Product” table that could be combined
into a hierarchy. (I say “could” because there is no requirement to create hierarchies.
They are a nice touch though.)
131
Chapter 6 Develop a Data Model
To initiate a hierarchy, right-click the field that will be at the top of the hierarchy. In
Figure 6-7, the top of the hierarchy is Category.
132
Chapter 6 Develop a Data Model
Once you have the hierarchy created, you can add fields to it in
several different ways. Shown in Figure 6-8 is how to initiate a hierarchy
using the Properties panel of the Model view.
Tip If you don’t see the Hierarchy option on the Properties pane, make sure
that you have selected the hierarchy.
A second way to add fields to your hierarchy is to right click. What happens if you
don’t start with the field at the top of the hierarchy? Or if you add the fields in the wrong
order? You can rearrange the fields, but the only place you do so is in the Model view
133
Chapter 6 Develop a Data Model
on the Properties panel. To rearrange the fields, drag them up or down, as shown in
Figure 6-9.
Hiding Fields
Why would you want to hide fields that you have worked so hard to bring into the model?
For several good reasons:
In Chapter 5, I mentioned that you should use dimension fields as labels for your
visuals and analyze fields from the fact table. But when both fields have the same
name, it isn’t always clear to a report consumer which one to use. But if you, the report
developer, hide the fields in the fact table, it will significantly reduce potential confusion.
The rule of thumb is to hide fields in the fact table and use the corresponding fields from
the dimension table. In Figure 6-10, observe that the two tables (Product dimension and
Sales fact) are connected by a relationship on ProductKey.
134
Chapter 6 Develop a Data Model
Figure 6-10. The Product dim table and the Sales fact table
In this example, it would be best practice to hide the ProductKey field in the Sales
table. The report consumers would have to use a field from the Product dimension table
as a label in a visual.
It is also best practice to hide “helper” fields—fields that are present to provide a
needed function but are not useful in a visual. An index field or a field that provides a
sort order is a good example of a “helper” field.
135
Chapter 6 Develop a Data Model
Hidden fields remain visible in the Power BI Desktop except in the Report view,
where they are hidden so they cannot be added to reports. If you want to see fields that
you have hidden in the Report view, right-click any blank area on the Fields pane,
and choose View hidden, as shown in Figure 6-11. Fields are not fully hidden until you
publish the report to the Power BI Service.
Summarization
A summarization is a computation on a column. I am using the term “summarization”
because that is what it is called in the ribbon, but the computation can be a SUM,
AVERAGE, COUNT, MAXIMUM, MINIMUM, or COUNTDISTINCT if the field is numeric. If the
field is text, the summarization can be COUNT or COUNTDISTINCT. The presence of a sigma
symbol next to the field in the Desktop indicates the presence of a default summarization
behavior, as shown in Figure 6-12. Later in this chapter, we will examine how to either
change this behavior or remove it.
136
Chapter 6 Develop a Data Model
Default Summarization
The default summarization that Power BI applies is a SUM if the field’s data type is a
number. During the refinement of your model, you should examine each field that has a
sigma symbol next to it and decide if that is an appropriate operation to apply. You can
perform this operation in any of the three views within the Power BI Desktop.
From either the Report or Data view, after selecting the field as shown in Figure 6-13
From the Model view, after selecting the field, as shown in Figure 6-14
137
Chapter 6 Develop a Data Model
The default summarization behavior is applied when you use that field in a visual.
You can also change the summarization in the visualization, which we will explore in
Chapter 7. There isn’t a best practice, per se, regarding default summarization. As a data
modeler, you decide if you want to leave the summarization in place. You can remove it
without a deleterious impact on your model as shown in Figure 6-15. On the other hand,
you can also leave it in place without a negative impact.
138
Chapter 6 Develop a Data Model
Categorization
For certain types of data, categorization can enable additional uses for the field in
question. Geographic data is most frequently categorized data. In Figure 6-16, you can
see how to categorize a field (in this case City), after selecting it.
3. Make sure your zip/postal codes are in a text data type; if they are
not, they cannot be categorized as a postal code.
Maps will work without categorization, but performing this step can remove
ambiguity. For example, if you have a column with an abbreviation CA, is that
California or Canada? Is AR Arkansas or Argentina? It is usually clear from the column
heading (Country or State); nonetheless, categorization is a form of insurance. Finally,
categorization will help the Q&A feature properly interpret a question about an address
or place (see in the following for more discussion about Q&A).
139
Chapter 6 Develop a Data Model
Another interesting example of categorization is for URLs. If your data has a URL that
points to an image or a web page, you want Power BI to display the image (or web page),
not the text of the URL. Categorizing the data as either an Image URL or a Web URL will
enable this capability.
The only indication that you have successfully categorized a field is when you
categorize a field geographically, a globe symbol will appear next to the field name on
the Fields pane as shown in Figure 6-17.
140
Chapter 6 Develop a Data Model
The Q&A engine reviews the data model and generates questions based on the
relationships between tables. (See Chapter 5 for more details on relationships.) The
questions use the names of the columns in each table, so naming the columns with a
user-friendly name (see Chapter 5 again) contributes to the success of Q&A.
1) Make sure to set the appropriate data types. For example, when
working with date columns, set them as Date data type. The
Q&A will be able to map the relevant date column to a “when”
question.
141
Chapter 6 Develop a Data Model
After you have created a robust model, there are four steps you can take in the Power
BI Desktop to enhance the user’s Q&A experience:
To access the Q&A setup within the Power BI Desktop, go to Modeling ➤ Q&A setup
as shown in Figures 6-19 and 6-20.
142
Chapter 6 Develop a Data Model
If the organization uses terminology that is significantly different from the field
names used in the model, setting up synonyms as you build your model is very helpful.
You can do this in either the Q&A setup menu or the Model view, as shown in Figure 6-21.
143
Chapter 6 Develop a Data Model
Security
Like setting up Q&A, setting up security is a two-step process. The first step happens in
the Desktop, and the second happens in the Service. This chapter covers the steps you
complete in the Desktop. A subsequent chapter will address the steps that are completed
in the Service.
Multilayer Security
There are multiple layers to the security options available in the Power BI Desktop.
Access Credentials
When connecting to a data source, you must enter your credentials. Those credentials
determine what you can access (as in a database). These credentials control what you
can access, not what the report viewer can see.
144
Chapter 6 Develop a Data Model
Row-Level Security
Once the data has been extracted, loaded into the data model, and combined, the model
creator must set up the security controls that will determine what data the viewers can
see in the report. This is called row-level security because the security controls the rows
that a viewer can see.
The key step in this process is setting up roles. Each role is limited to specific data,
based on DAX expressions. To set up these roles, click the Manage roles tile on the Home
tab as shown in Figure 6-22.
Set up the role with the appropriate DAX to restrict the data that the reader can view.
In the following example, the role is restricted to viewing the data of customers who are
based in Germany as shown in Figure 6-23.
145
Chapter 6 Develop a Data Model
In this example, the restriction is simple. Roles can be set up using multiple
conditions and much more complex DAX. One very common restriction is using the
UserPrincipalName function, which allows you to set up restrictions based on a person’s
identity. This type of security is called dynamic row-level security.
The first step to set up dynamic security is to create a table in the model that lists
the relevant users and assigns them a unique ID. In Figure 6-24, you can see a very
simplified example of such a table.
The next step is to assign user access to specific data using the user’s unique ID. In
Figure 6-25, you can see that only Megan Bowen has access to the A. Datum and
Litware brands.
147
Chapter 6 Develop a Data Model
Figure 6-26. The key to dynamic security is the relationships in the model
Now that the relationships are in place, there is one more step: to create a new
role that explicitly states that the data a user will have access to depends on their User
Principal Name (UPN). In Figure 6-27, you can see an example of such a role.
148
Chapter 6 Develop a Data Model
Figure 6-27. Setting up a role that explicitly ties visibility to the UPN
Once you have set up the necessary roles, the next step is to test the role, which you
can do using the View as function. In the following are two figures—Figure 6-28 that
has no row-level security in place and Figure 6-29 when viewed as the Germany Account
Manager role.
149
Chapter 6 Develop a Data Model
150
Chapter 6 Develop a Data Model
Once the roles are established and tested, the second step is to assign users to roles
in the Service, which will be covered later.
151
CHAPTER 7
Measures
What do you use when a calculated column is not necessary? For example, in the earlier
chapter, we created a column that calculates the total for each row ([LineTotal]), but
we need to know the total for all sales, not just the total line by line. We need a measure,
which is a calculation not currently present in the data. In Figure 7-1, you can see how to
enter a measure in the Formula Bar:
All_Sales=SUM('Orders Details'[LineTotal])
153
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2_7
Chapter 7 Create Model Calculations Using DAX
This expression adds up the entire column called LineTotal in the table called
'Orders Details' and creates a measure called All_Sales. A measure is stored inside
the data model (which is why the topic is introduced in this chapter). Because a measure
is not materialized, it does not require resources from the engine until it is used in a visual.
Tip You won’t see a measure in the Data view because it is not materialized.
Let’s revisit DAX’s basic behavior. In my classes, I search for analogies that may
resonate with my audience. I have started to call DAX the “Cookie Monster.” (For folks
who did not grow up with Sesame Street, “Cookie Monster” is known for gobbling down
cookies.) DAX’s innate behavior is to “gobble” up columns and produce the result, unless
it is iterating (going row by row), as we covered in the previous chapter. With this in
mind, let’s analyze the simple measure used in Figure 7-1:
All_Sales=SUM('Orders Details'[LineTotal])
Right away, you should notice that unlike calculated columns, a measure requires a
function, such as SUM, AVERAGE, MIN, or MAX. In our simple example, the measure
is using SUM. The function tells DAX what operation you want to perform. The result of
this measure is that the entire 'Orders Details'[LineTotal] column is added up.
All_Sales_Average=AVERAGE('Orders Details'[LineTotal])
154
Chapter 7 Create Model Calculations Using DAX
• Table names do not require single quotes around them unless the
name has a space in it. (Nonetheless, I make it a practice to always
enclose my table names with single quotes because that way I won’t
forget to put them in when necessary.)
155
Chapter 7 Create Model Calculations Using DAX
As you start typing the name of a function, it will prompt you with the available
functions that start with the letters you have typed in as shown in Figure 7-2. You can
select the appropriate function from the list.
After selecting the function, IntelliSense will prompt with an explanation of the
function and a list of the mandatory and optional arguments. Optional arguments are
enclosed in square brackets, as you can see in Figure 7-3.
To see a list of tables (and columns) available in the model, simply type in a single
quote. You can select from the provided list of tables and fields, as shown in Figure 7-4.
156
Chapter 7 Create Model Calculations Using DAX
Figure 7-4. Enter a single quote to see a list of tables (and columns)
To see a list of measures available in the model, type in a left square bracket, as
shown in Figure 7-5.
Figure 7-5. Enter a left square bracket to display a list of measures in the model
If you are new to DAX, using IntelliSense can guide you toward writing DAX that
is syntactically correct. This does not mean that the DAX you write will work. You should
test every measure in a simple visual to see the results of the DAX you have written.
Tip Many people test their DAX by using simple data and performing the same
calculation in Excel. This is a great way to understand what DAX is doing.
157
Chapter 7 Create Model Calculations Using DAX
Filter Context
Continuing with the “Cookie Monster” analogy, what if we want to split the cookie up,
rather than just letting the “Cookie Monster” gobble the whole cookie in one bite? Enter
the filter context.
The measure All_Sales produces a single number. How can we see, for example,
the sales for companies in Germany? The first way, the simplest way, is to set up a slicer
visual, set to “Germany,” as shown in Figure 7-6.
We can create the same filter context by putting the 'Orders Details'[Country]
field into the Filters pane and setting it to “Germany,” as you can see in Figure 7-7.
158
Chapter 7 Create Model Calculations Using DAX
There are numerous ways that a filter context can be introduced. In the preceding
figures, you can see the obvious ways: using a slicer or the Filters pane. Some other
ways include
• A synced slicer
159
Chapter 7 Create Model Calculations Using DAX
In Figures 7-6 and 7-7, the slicer or Filters pane selection is affecting everything on
the page. (I am only showing one visual, to keep the figure simple.) What happens if you
want to include the total value of [All_Sales] on the same visual where it is also filtered?
We need a new tool to be able to control the filter context’s impact on a measure.
Introducing CALCULATE
Not surprisingly, DAX has just such a tool available: the CALCULATE function. After
practicing with simple measures, the next function to master is CALCULATE, because it
allows you to fine-tune and control the filter context. Here’s a measure that removes any
filtering coming from the 'Customers'[Country] field:
All_Sales_AllCountries=
CALCULATE(
[All_Sales],
REMOVEFILTERS('Customers'[Country]
)
The CALCULATE function requires only one argument: the expression to calculate.
In the preceding example, the expression is [All_Sales], a measure already created
in the model. In addition to the required argument, CALCULATE can take optional
arguments as shown in Figure 7-8.
160
Chapter 7 Create Model Calculations Using DAX
CALCULATE does not wipe out the existing filter context. It superimposes the filter
conditions you have included in the CALCULATE measure onto the existing filter context.
In our measure All_Sales_AllCountries, the REMOVEFILTERS function scans the
filter context for any filters coming from the ‘Customers'[Country] field and removes
them prior to calculating the measure, as you can see in Figure 7-9.
It is very important to realize that this measure will not remove any filters coming
from another field in the 'Customers' table or from a field in another table. If, for
example, we add the 'Product'[Category] field to the Filters pane, the All_Sales_
AllCountries will reflect that change in the filter context as shown in Figure 7-10.
161
Chapter 7 Create Model Calculations Using DAX
The other optional argument that CALCULATE will accept is a model modifier
argument. Examples of these include USERELATIONSHIP and CROSSFILTER functions.
It is possible to “hard-code” a filter selection using CALCULATE:
All_Sales_GermanyandBeverages=
CALCULATE([All_Sales],
'Customers'[Country]= "Germany",
'Categories'[CategoryName]= "Beverages"
)
162
Chapter 7 Create Model Calculations Using DAX
But what happens if we set the filters on the Filters pane to a different country and
a different category? Spoiler alert: The hard-coded measure does not respond to the
filter context, as shown in Figure 7-12.
163
Chapter 7 Create Model Calculations Using DAX
In the following table, I have listed all three example measures and how they are (or
are not) modifying the filter context.
164
Chapter 7 Create Model Calculations Using DAX
165
Chapter 7 Create Model Calculations Using DAX
By contrast, the
external filter context
also has a filter
Category=Condiments.
This external filter is
included when calculating
the measure, because
nothing in the CALCULATE
statement changes this
external filter.
166
Chapter 7 Create Model Calculations Using DAX
• KEEPFILTERS
• ALL
• ALLEXCEPT
• ALLSELECTED
Every filter modifier argument for CALCULATE does one of two things: removes
existing filters or adds a filter. Two different modifier arguments can be combined
as well.
SampleMeasure=CALCULATE
(SUM('Orders'[Sales]),
USERELATIONSHIP('Date'[Date], 'Orders'[ShipDate]))
167
Chapter 7 Create Model Calculations Using DAX
Row Context
Now that we have introduced the filter context, let’s reintroduce the row context. You
may recall that I mentioned the row context in the previous chapter, when explaining
calculated columns. But the row context is broader than just a calculated column. Let’s
use the same example we used in the last chapter: calculating sales (not including
discount value). We can create two calculated columns called [Subtotal] and
[LineTotal] using these expressions:
Subtotal=
'Orders Details'[Quantity]* 'Orders Details'[Unit Price]
LineTotal =
'Orders Details'[Subtotal]-'Orders Details'[DiscountValue]
LineTotalAsMeasure =
SUMX (
'Orders Details',
('Orders Details'[Quantity] * 'Orders Details'[UnitPrice]) - 'Orders
Details'[Discountvalue]
)
Iterator functions have an X at the end of them: SUMX, AVERAGEX, MAXX, MINX,
and COUNTAX are examples. (Not every function has an iterator equivalent.) An iterator
function evaluates an expression, row by row. In our model, we have three different
methods to calculate the sales total:
In Figure 7-13 you can see all three methods used in the same visual.
168
Chapter 7 Create Model Calculations Using DAX
When should you create a calculated column and when should you use a measure
with an iterator function? The answer is one we have already talked about: create a
calculated column when you need to use the resulting values in a slicer or filter, as
shown in Figure 7-14. You can’t use a measure in a slicer or a filter.
169
Chapter 7 Create Model Calculations Using DAX
170
Chapter 7 Create Model Calculations Using DAX
171
Chapter 7 Create Model Calculations Using DAX
Figure 7-16. The results of an implicit and explicit measure side by side
172
Chapter 7 Create Model Calculations Using DAX
Once all the necessary explicit measures have been created, the “base” field
can be hidden. As I stated in Chapter 6, the hidden column is not hidden from the
report developer in the Power BI Desktop. Rather, hiding a base column (or any field)
streamlines the model once the report is published.
Tip It would not be unusual to hide all the fields in the fact table. Doing so
ensures that report creators would have to use the dimension table fields to create
a visual, which is almost always preferable.
Quick Measures
Learning to write DAX is a nontrivial effort. There is a way to jump-start your learning:
use the Quick measure feature. In Figure 7-18, you can see the Quick measure menu.
173
Chapter 7 Create Model Calculations Using DAX
Figure 7-18. There are built-in calculations in the Quick measure dialogue box
To create a quick measure, drag fields from the list on the right-hand side to the
appropriate field well on the left-hand side of the dialogue box. Let’s create a measure
that calculates the average value for the orders of each product, as shown in Figure 7-19.
174
Chapter 7 Create Model Calculations Using DAX
The Quick measure wizard writes the DAX for you, which you can see once the
measure is created.
175
Chapter 7 Create Model Calculations Using DAX
Tip Select the table where you want the measure to appear, then right-click,
and choose Quick measure. This will ensure that the measure appears in the
selected table. You can always re-home a measure (and a measure doesn’t care
where it is), but it is nice to be able to find a measure quickly.
Once the Quick measure wizard has created the measure, it will be named
something awkward such as Price Minus Cost. You will almost always want to rename
these measures.
Caution It does take a long time to learn how to write good DAX, and the Quick
measure wizard is a useful way to get started. However, DAX masters say that the
DAX created by the Quick measure wizard can be “clunky.” This should not deter
you from taking advantage of the wizard, but be aware that the DAX it generates
can be improved.
• Logical
• Aggregation
• Statistical
• Text
• Time intelligence
• Mathematical/trigonometric
• Date/time
• Filter
• Table manipulation
• Financial
176
Chapter 7 Create Model Calculations Using DAX
• TOTALYTD
• SAMEPERIODLASTYEAR
• PARALLELPERIOD
It’s unnecessary for me to list all the time intelligence functions as that information is
easily found with a simple web search. Rather, I want to use this space to share some tips
and tricks for using this group of functions:
YTD Sales =
TOTALYTD(
SUM('Orders Details'[LineTotal]),
'DateDim'[Date])
177
Chapter 7 Create Model Calculations Using DAX
178
Chapter 7 Create Model Calculations Using DAX
Figure 7-21. Using a time intelligence function without a date field can be
ambiguous
Sales_Last_Year =
CALCULATE([All Sales],
PARALLELPERIOD('DateDim'[Date],-12,MONTH)
)
There is a function called PARALLELPERIOD, which allows you to set the clock back
(or forward) to compare two time periods. In Figure 7-22, you can see the results of this
measure.
179
Chapter 7 Create Model Calculations Using DAX
Semi-additive Measures
Not everything that we want to calculate should result in a grand total. I call these types
of calculations “point-in-time” calculations. Officially, these types of calculations are
called semi-additive. The classic example is a bank balance. When you check your bank
balance, it is a “snapshot” of your balance at that point in time. Another example is
inventory balances. If you are calculating inventory, you don’t want to see a total of the
inventory over the month; you want to see the inventory at that point in time.
Once again, DAX to the rescue! There are multiple functions that can be used to
make these calculations. Examples include
• OPENINGBALANCEYEAR
• CLOSINGBALANCEYEAR
• ENDOFMONTH
• STARTOFMONTH
Once again, I am not going to list all the semi-additive measures. A great place to
research these functions is www.sqlbi.com. They have posted in-depth articles on how
these functions work.
180
Chapter 7 Create Model Calculations Using DAX
Instead, I want to use the space to talk about semi-additive calculations that do
not have dedicated functions. What if you want to total all the sales in each category,
but each category is managed by a separate division and therefore adding them up
is not meaningful? I call these non-totaling calculations. You can see an example in
Figure 7-23.
Your first thought might be to change the visual in some way. Tables and matrices
have a formatting setting where you can turn off subtotals, as shown in Figure 7-24.
181
Chapter 7 Create Model Calculations Using DAX
But this is not a solution because any other field you add to the visual will also not be
totaled. But there are functions that allow you to turn off the total value without resorting
to clumsy formatting:
• HASONEVALUE
• HASONEFILTER
• ISINSCOPE
182
Chapter 7 Create Model Calculations Using DAX
These are functions that test for a condition and, if the condition is true, perform the
expression and, if it is false, leave a blank. Here’s an example:
Non-Total All_Sales =
IF(
HASONEVALUE('Categories'[CategoryName]),
[All Sales]
)
All these functions use the IF function to perform the logical test. In the
preceding measure, the logical test is whether, in the current filter context, the
'Categories'[CategoryName] field has one value. If the test returns true, then the [All
Sales] measure is calculated. If the test returns a false, then the measure returns a blank
(because the false argument is not included) as shown in Figure 7-25.
Figure 7-25. Using HASONEVALUE to turn off the totaling for one column
183
Chapter 7 Create Model Calculations Using DAX
The easiest way to see this is in a matrix. To create this matrix, I first created a hierarchy
in the data model, but the example works without a formal hierarchy as well. Then I
created three measures using ISINSCOPE:
In Figure 7-26, you can see how these measures perform in a matrix.
184
Chapter 7 Create Model Calculations Using DAX
In the Address_All_Sales column, the measure tests for the presence of the
'Suppliers'[Address] in the current filter context. Because the test returns TRUE, the
All_Sales measure is calculated. The next column, City_All_Sales, tests for the presence
of 'Suppliers'[City]. The test returns true for both the row with the city name and for the
row with the address. Anything that is lower in the hierarchy is considered in scope.
In the preceding example, I used the formal hierarchy that I created. If I were to use
the base fields, the result would be the same.
Statistical Functions
In the exam prep items for PL-300, there is a specific entry for the DAX statistical
functions. I am going to be candid here and state that I really don’t know why this subset
of DAX functions was mentioned specifically. Statistical functions work the same way as
other DAX functions. My guess is that while most of us can intuitively understand a logic
or mathematical function, we may not be as familiar with basic statistics. I recommend
that you familiarize yourself with some basic statistical principles, such as median,
average, and standard deviation.
185
Chapter 7 Create Model Calculations Using DAX
186
CHAPTER 8
Optimize Model
Performance
When you first start writing DAX, you are bound to write some “ugly baby” DAX—DAX
only an author can love! And that is okay—at the beginning. There’s an expression
“Perfect is the enemy of done,” which means don’t let the quest for perfect DAX get in the
way of writing DAX. Good DAX takes practice and some tools, one of which is built into
the Power BI Desktop.
The Performance analyzer will open. To use the Performance analyzer, click
Start recording, as shown in Figure 8-2.
187
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2_8
Chapter 8 Optimize Model Performance
Once you have started recording, begin interacting with your report page. In the
following example, I sorted the CompanyName column as shown in Figure 8-3.
Figure 8-3. Note the four entries under the name Table
188
Chapter 8 Optimize Model Performance
// DAX Query
DEFINE
VAR __DS0Core =
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL('Customers'[CompanyName],
"IsGrandTotalRowTotal"),
"TotalOrderValue", 'DAX Measures'[TotalOrderValue],
"LargestLineValue", 'DAX Measures'[LargestLineValue],
"AverageOrderValue", 'DAX Measures'[AverageOrderValue]
)
VAR __DS0PrimaryWindowed =
TOPN(502, __DS0Core, [IsGrandTotalRowTotal], 0,
'Customers'[CompanyName], 1)
EVALUATE
__DS0PrimaryWindowed
ORDER BY
[IsGrandTotalRowTotal] DESC, 'Customers'[CompanyName]
Tip A great way to start improving your DAX is to copy the queries from the
visuals you create. You may not understand everything in the query, but you can
start to get a “feel” for the syntax and logic of DAX.
Cumulatively, the number of separate DAX queries on a page can slow page
responsiveness. If this starts to happen, open the Performance analyzer and interact
with each visual in turn. Identify the slowest elements of the visual. If the DAX query
component is slow, and if your visual uses measures or calculated columns, you can
optimize those elements by rewriting the DAX. You cannot modify the DAX on which the
visual is based.
189
Chapter 8 Optimize Model Performance
190
Chapter 8 Optimize Model Performance
Source Remediation
As you can see, report performance is dependent on many factors, many of which
should be addressed before creating the first visual.
191
PART IV
Create Reports
When I teach, I notice that many students use the terms “report” and “dashboard”
interchangeably. Understandably so, because from a user perspective, the function of a
report is to serve as a dashboard, as defined by the Oxford Dictionary:
A graphical summary of various pieces of important information, typically
used to give an overview of a business.
In the Power BI ecosystem, reports and dashboards are two different elements that
can be created. Let’s compare reports and dashboards, side by side.
Reports Dashboards
Can be created in the Power BI Desktop Can only be created in the Power BI Service
or the Power BI Service
Multiple pages One virtual page
Must be underpinned by a data model Uses visuals from published reports
Can be shared via apps Can be shared via apps
Cannot contain streaming content Can contain streaming content
In this chapter, we will explore reports in depth. In Chapter 13, we will address
dashboards.
The Canvas
When you launch the Power BI Desktop, it will open in the Report view. When you
are new to Power BI, this canvas can be a little daunting. Where to start? A good place
is to set up the overall parameters for your report. In Figure 9-1, you can see all of the
formatting options available for the report and page.
195
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2_9
Chapter 9 Create Reports
Starting from a blank page (or after selecting the white area of your page) in the
Format page menu, there are a lot of formatting options. Going by the numbers in the
preceding screenshot, here is a brief description of each formatting card:
196
Chapter 9 Create Reports
6. Filter cards: You can change the look and feel of the individual
filter cards.
197
Chapter 9 Create Reports
Built-In Themes
If you need somewhere to start, there are several themes built into the Power BI Desktop,
under the View menu, as shown in Figure 9-3.
198
Chapter 9 Create Reports
Just as in PowerPoint, the chosen theme determines the color palette used in the
visuals. Be careful, though, to not overwhelm your report readers with different color
schemes in reports and dashboards.
Once a theme is selected, it is possible to customize the theme at a very detailed level
as shown in Figure 9-4.
199
Chapter 9 Create Reports
Accessibility
Making reports readable by everyone should be a priority for anyone designing a report.
Doing so, however, is a nontrivial exercise. I am not qualified to write a comprehensive
guide to accessibility, but I can point out some key techniques:
• There are fonts that are preferred for accessibility. Make sure that
your report uses these fonts.
200
Chapter 9 Create Reports
• Every report should be tested with a screen reader, to ensure that all
the accessibility settings are present.
Visualizations
At the heart of every report are the visualizations. The visualization is the materialization
of all the hard work of transforming and modeling the data. Because 80% of the work
to create a report lies in transformation and modeling, choosing, populating, and
formatting the visuals should take far less time. Despite this reality, when first getting
started with Power BI, the visualization component looms large.
Standard Visuals
Power BI offers a standard list of visualization types, which periodically expands to
include a new visualization. As of this writing, there are 37 standard visuals available as
you can see in Figure 9-5.
201
Chapter 9 Create Reports
To select one, simply click once the icon. To change the visualization, select the
visualization on the canvas, and then click the icon for the new visualization. It is
possible to drag a field directly onto the canvas, which will create a table visual. It is
also possible to drag a field onto the “placeholder” for the visual. When you use this
technique, the Desktop will automatically pick a field well in which to place this field. If
you have ever created a pivot table in Excel, you are familiar with this behavior as shown
in Figure 9-6.
Every visualization has unique field wells in which fields can be placed. My preferred
method for building my visuals is to drag a field to a specific field well, but of course, this
is personal preference.
202
Chapter 9 Create Reports
Custom Visuals
If the standard visual menu doesn’t offer the type of visualization you are looking for,
there is a large “aftermarket” of custom visuals, created by developers. You access the
menu by clicking the ellipsis in the Visualizations menu, as shown in Figure 9-7.
Many companies limit access to custom visuals, considering them security risks.
There are custom visuals that have been certified by Microsoft, and many organizations
consider that sufficient risk mitigation. Some custom visuals do require an additional
purchase.
203
Chapter 9 Create Reports
Before using a custom visual type (if your organization allows them), be sure to
explore all the formatting features for the standard visual types that suit the data.
Formatting Visuals
Every visual type has formatting features common to all visuals and formatting features
unique to that visual type. Access these features by choosing the Format visual menu,
as shown in Figure 9-8.
1
I would like to credit SQLBI for these visualization categories. For an excellent one-page
reference, go to www.SQLBI.com for a downloadable PDF.
204
Chapter 9 Create Reports
Tip When using a visualization for the first time, always make the time to explore
all the features specific to the visual type.
205
Chapter 9 Create Reports
Configuring Visualizations
Once the right visualization type is selected and formatted, there are some controls that
every visual has in common, which are in the visual header as shown in Figure 9-9.
206
Chapter 9 Create Reports
Slicers
A slicer is a form of visual. You can have multiple slicers on a page, and you can
have slicers that control several pages. Setting up slicers is easy, and users intuitively
understand what to do with a slicer. Select a slicer the same way you would any other
visual, as shown in Figure 9-11.
207
Chapter 9 Create Reports
Tip Any visual can be populated using one of these three ways, but if the
visual has more than one field well, Power BI may put the field in an unexpected
field well.
Slicers have different configuration options based on the data type of the field used.
These options are underneath a caret in the upper-right corner, as shown in Figure 9-12.
Note In the most recent version of Power BI Desktop (as of this writing), these
settings have moved to the Format Visuals menu.
208
Chapter 9 Create Reports
Figure 9-12. You can change the type of slicer in the slicer header
If the data type of the field is text, there are two options for the slicer format:
• List
• Drop-down
If the data type is a number, there are five options for the slicer format:
• List
• Drop-down
• Between
If the data type is a date, there are seven different options for the slicer format:
• Between
• Before
• After
• List
• Drop-down
• Relative date
• Relative time
209
Chapter 9 Create Reports
Like other visuals, slicers have unique formatting settings. One of the most important
ones is the Slicer settings, as shown in Figure 9-13.
There are custom slicers available as well, but as always, investigate all the formatting
settings for the standard slicer before resorting to a custom slicer.
210
Chapter 9 Create Reports
Tip Any visual element can be copied. However, as of this writing, when copying
a button, you will not be able to right-click a button and choose Copy visual.
Simply select the button and Ctrl+C.
When copying a slicer, Power BI will ask if you want to sync the copy of the slicer with
the original as shown in Figure 9-15. If two slicers are synced, a selection made on one
slicer will be reflected on the synced slicer(s), even if on different pages.
211
Chapter 9 Create Reports
Once you have synced some slicers, you might want to fine-tune the sync settings
or initiate syncing without copying a slicer. To do so, you need to open the Sync slicers
panel: View ➤ Sync slicers as shown in Figure 9-16.
Once you have the Sync slicers panel open, make sure you select one of the
slicers you want to sync or to adjust. The Sync slicers panel has two columns: one for
syncing the slicers and one for rendering the slicers visible (or not). You can see the Sync
slicers panel in Figure 9-17.
212
Chapter 9 Create Reports
Tip Even though you can have “invisible” slicers on a page, use this feature
cautiously. It could be very confusing to a report user to have a page filtered
without any visible indicator.
If you have ever created a pivot table, you are familiar with how to populate the
Filters pane—drag the field you want to use on the Filters pane directly onto it as
shown in Figure 9-19.
214
Chapter 9 Create Reports
You can drag multiple fields into the same area of the Filters pane. Using a field on the
Filters pane provides two and sometimes three options for filtering as shown in Figure 9-20:
• Basic filtering
• Advanced filtering
Basic filtering operates very similarly to a slicer. More compelling is the Advanced
filtering option afforded by the Filters pane as shown in Figure 9-21.
216
Chapter 9 Create Reports
Figure 9-21. Advanced filtering offers the opportunity to combine filter conditions
The third type of filtering, Top N, is available for Filters on this visual, as you
can see in Figure 9-22.
217
Chapter 9 Create Reports
Figure 9-22. The Top N filtering is available for Filters on this visual
You, as the report developer, decide how much control the report user will have
on the Filters pane. If the report user should not be able to change the filter pane
settings, you can lock individual filter cards. Similarly, if the user should not even see the
filter card, you can hide that card. Remember, by hovering over the Filters icon on a
particular visual, the user can see the filters impacting an individual visual.
218
Chapter 9 Create Reports
219
Chapter 9 Create Reports
Figure 9-23. Numbers 5 and 6 have formatting features for the Filters pane
If you want the Filters pane to appear continuous with the report page, you can do
so by using the same color scheme as your canvas and/or background.
Drill-Through
In addition to synced slicers, there is another way to transmit a filter from one page to
another: the drill-through feature. When you use a field as a drill-through field on a
particular page, you can navigate directly to that page from another page and visual where
that field appears. Sounds confusing? Don’t worry—it’s easy once you have set one up. The
first step is to drag the selected field to the Drill through area of the Visualizations pane
on the destination page for the drill through, as shown in Figure 9-24.
220
Chapter 9 Create Reports
221
Chapter 9 Create Reports
When the back button appears in the upper left-hand corner, you have set up the
drill-through successfully as shown in Figure 9-25.
Once you have set up the drill-through page, return to the report page from which
you want to drill. On that page, select a visual that uses the drill-through field (in the
preceding example, the field is CategoryName). Select one of the data points and right-
click. From there, follow the Drill through menu, as shown in Figure 9-26.
222
Chapter 9 Create Reports
The purpose of the drill-through is to be able to make a selection on one page and
have it “carry through” to another page in the report. A side benefit is that any other filter
on the originating page will also be carried through to the drill-through page. As shown
in Figure 9-28, if you have a slicer on the originating page, any selection made on that
slicer will be reflected on the drill-through page. You can prevent other filters carrying
over to the drill through destination page by toggling the Keep All Filters setting to “off”.
223
Chapter 9 Create Reports
Figure 9-28. The selected value on a slicer will also be “carried through” to the
drill-through page
224
Chapter 9 Create Reports
Conditional Formatting
Some Power BI visuals (specifically tables and matrices) have conditional formatting
built into them. The Conditional formatting in Power BI works very similarly to that
in Excel. As shown in Figure 9-29, access the Conditional formatting menu by clicking
the down arrow next to the field you want to format.
• Background color
• Font color
• Icons
• Web URL
225
Chapter 9 Create Reports
Because most readers will probably have used conditional formatting in Excel, I will
focus on the interesting nuances in Power BI.
Web URL
If you have data that is readily viewed on the Internet, you might want to make it easy
for your report reader to easily access the appropriate page. But first, you must create a
connection between the field you want to format and the web URL address. Figure 9-31
shows a simple example.
226
Chapter 9 Create Reports
Figure 9-31. Adding a custom column for conditional formatting as a web URL
Once the web address is present in the data model (and related to the field you want
to format with it), you can set up the conditional formatting:
2) Set the format to be based on the value in the Web Address field,
as shown in Figure 9-32.
Figure 9-32. Base the conditional formatting on the content of the Web
Address field
227
Chapter 9 Create Reports
228
Chapter 9 Create Reports
An easy example to demonstrate this capability is to create a title that will vary based
on a particular value that is selected. The measure is
Title=
"All Sales by Country for "
& SELECTEDVALUE('Suppliers'[CompanyName])
Once you have created the measure (using the same methodology to create any
measure), you can “point” the Title field to the measure. Eliminate any title content that
already exists for the visual as shown in Figure 9-34.
Point the title text to the measure that you created as shown in Figure 9-35.
229
Chapter 9 Create Reports
Because of the DAX function used in the measure (SELECTEDVALUE), the title will
reflect a value chosen for the name of the supplier as you can see in Figure 9-36.
Figure 9-36. The title reflects the selection for the supplier name made on the
Filters pane
This is just one example. I am choosing to show the process so that the idea isn’t
completely theoretical. The specifics aren’t as important as the overall concept.
230
Chapter 9 Create Reports
Text Boxes
You can also place text boxes on the page to provide instruction or further details. Note
that the text box contains static text. To create variable text, you need to use either the
card visual type or buttons (see in the following).
Buttons
Buttons have (relatively) recently received an upgrade in features. The new capabilities
now make buttons a great option to use instead of the single-value cards because they
have more formatting options. When you add a button to your page, it will always appear
in the upper left-hand corner of the page. There are several types of buttons:
• Reset
• Back
• Information
• Help
• Q&A
• Bookmark
• Blank
• Navigator
Most of these button settings are self-evident, or will be with a little experimentation,
which I encourage you to do. Here, we will delve into the Blank and Navigator button
types. As shown in Figure 9-37, access the Buttons menu through the Insert tab.
231
Chapter 9 Create Reports
After inserting a button, the Format ➤ Button pane will appear. Of all the features a
button has, the Action feature (shown in Figure 9-38) is the most important. Without an
action, a button is a fancy text box.
232
Chapter 9 Create Reports
• Drill through
• Web URL
What if you are not sure that your users will be savvy enough to right-click to drill
through to another page? Placing a button on the page can make the process more
transparent to the user. The first thing to do is to Insert ➤ Buttons ➤ Blank.
Once the button is on the page (remember, it will show up in the upper left-hand
corner), you can move it to an appropriate place on the page. Once the button is placed,
select it, and configure the Action to Drill through, as shown in Figure 9-39.
233
Chapter 9 Create Reports
Once the button action is set up, add instructional text to tell your report user
how to use the button, as shown in Figure 9-40. To do so, go to Format ➤ Visual ➤
Style ➤ Text.
234
Chapter 9 Create Reports
Button States
Not only do buttons have lots of format options; they also can be formatted differently
based on their “state.” A button offers four states:
• Default
• On hover
• On select
• Disabled
You can add text or another formatting that is appropriate to that particular state. In
this example, I am choosing to put the following text for two different states:
235
Chapter 9 Create Reports
Figure 9-41. Setting the button text for the Default state
Figure 9-42. Setting the button text for the On hover state
Now, all the report user must do is click the button to drill through. Leveraging the
states of a button allows you to design in layers of functionality and instruction on the
same page.
236
Chapter 9 Create Reports
237
Chapter 9 Create Reports
Once you have added the Page navigator button to a report page, you can configure
it in multiple ways. Two of the most important configurations are the ability to show (or
hide) hidden or tooltip pages as shown in Figure 9-44. Using the Page navigator button
greatly simplifies page navigation and management.
Figure 9-44. Setting the page navigator button to not show hidden or
tooltip pages
Paginated Reports
After spending many pages describing how to create a report in the Power BI Desktop,
there are times when this kind of report won’t do:
• If the report must include all the rows of a long table (e.g., an
inventory report)
238
Chapter 9 Create Reports
Once the report is created, you can publish it into the Service if you have Admin,
Member, or Contributor rights to a workspace in a Premium capacity. If those terms
mean nothing to you, fear not. We will be covering the Service in upcoming chapters.
239
CHAPTER 10
Enhance Reports
In Chapter 9, we covered the steps and features for creating a report. In this chapter, we
will delve a bit deeper into some of the features we have already covered and explore
some new ones. Because in some cases we are talking about enhancements to features
we covered previously, you may need to page back and forth between these two
chapters.
241
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2_10
Chapter 10 Enhance Reports
These controls will only appear if you have multiple fields in a field well, as you can
see in Figure 10-3.
242
Chapter 10 Enhance Reports
Notice that I don’t say “in a hierarchy,” which is a specific structure you can set up
in a data model, which was covered in Chapter 6. You can use a hierarchy, which will
enable the drill down and expand all down controls.
When clicking the “trident” once, the next layer in the hierarchy will display as you
can see in Figure 10-4.
243
Chapter 10 Enhance Reports
Figure 10-4. Category and Subcategory fields are visible after clicking the
“trident” once
After hitting the “trident” twice, the next field (Product Name) in the arrangement is
visible, as shown in Figure 10-5.
Figure 10-5. Category, Subcategory, and Product Name are all visible
244
Chapter 10 Enhance Reports
The next icon, the double arrows, displays each “layer” of the data by itself, as shown
in Figure 10-6.
Figure 10-6. The double arrows show the next level of the hierarchy but not the
level above it
Finally, when you are done drilling or expanding down, to go back up the hierarchy,
use the drill up arrow, as you can see in Figure 10-7.
245
Chapter 10 Enhance Reports
246
Chapter 10 Enhance Reports
Figure 10-8. Selecting the USA data point highlights the sales by category in
just the USA
The reverse is also true. Making a selection on the bottom visual will highlight the
appropriate values on the top visual, as shown in Figure 10-9.
Figure 10-9. Interactions work from any visual to any other visual
247
Chapter 10 Enhance Reports
• Filter
• None
There are some visual types (such as maps) that do not highlight—they can only be
filtered or have no interaction. The report developer can control the types of interactions
visuals have with each other, either in the Power BI Desktop or in the Service. In this
chapter, we will cover controlling interactions using the Desktop.
The first step in controlling interactions is to turn the feature on under Format ➤
Edit interactions. (To see the Format contextual menu, select a visual first.) Once Edit
interactions is toggled on, a new set of icons will appear in the visual header (either in
the top right-hand corner or the bottom right-hand corner) as shown in Figure 10-10.
248
Chapter 10 Enhance Reports
If the visual does not support highlighting, you won’t see the highlight icon.
Interactions are controlled from the selected visual to the other visuals on the page. In
other words, to edit interactions you select the source visual first and then change the
interactions it has with the other visuals. The current interaction mode is darker than the
other options, as you can see in Figure 10-11.
Figure 10-11. Editing interactions from the selected visual to the others on
the page
The interaction between two types of visuals does not have to be reciprocal. In the
preceding example, All Sales by Country can highlight All Sales by Category, and
All Sales by Category can filter All Sales by Country.
Tip When selecting colors for your theme, be sure to consider how the colors will
look when highlighted. A light color will be difficult to see once it is grayed back
and therefore difficult for a screen reader to “read.”
249
Chapter 10 Enhance Reports
Bookmarks
In theory, there are no limits on the number of pages in a report or, at least, none that
I have been able to find. With that said, there is a limit to the number of pages a report
user is going to be willing to tab through. But what if you have a lot of information to
share? Or what if you want to make your report users’ lives a little easier by providing
them with “shortcuts” to see details that you don’t want to put on the “front page”? In
either scenario, and in many more, bookmarks are the answer.
What is a bookmark? It is a saved view of a page. How do you create one? Easy. Go to
View ➤ Bookmarks to open the Bookmarks pane as shown in Figure 10-12.
Once the Bookmarks pane is open, your next step is to make selections on your
page to “capture.” The easiest example is to set a slicer (or a filter on the Filters pane)
to a particular selection. In Figure 10-13, I have set the 'Customers'[Country] field
to Canada.
250
Chapter 10 Enhance Reports
Once the bookmark is created, rename it something that will make it clear what the
bookmark captures as is shown in Figure 10-14.
251
Chapter 10 Enhance Reports
Once the bookmark is added, the report user can see that captured view by selecting
the bookmark. (More on how to make this easier a little further down.) What happens,
though, if you make a change to the page? The bookmark may not reflect this change. If
you add (or change) something to the page, you it is a good idea to update the bookmark
as shown in Figure 10-15.
Once you have created your bookmark, you can then revert to the default (or
standard) view. If you make a change to the page that you want reflected on the
bookmark, remember to select Update after making the change.
Tip I find it easier to create a Default View bookmark first and then build
bookmarks from that. You can delete the Default View bookmark once you have all
of the bookmarks created.
252
Chapter 10 Enhance Reports
And there is a bonus: both the page and bookmark navigator buttons have all of the
rich formatting options available for buttons.
253
Chapter 10 Enhance Reports
• Data
• Display
• Current page
• All visuals
• Selected visuals
254
Chapter 10 Enhance Reports
Understanding the nuances of each of these settings is not on the PL-300 exam.
However, the first time you create a bookmark, you will probably be curious about
what each of these settings does. I will summarize the Data and Display options, and I
encourage you to experiment with the others for yourself.
Data: Preserves the filtering and/or slicing selections you made when you first
created (or when you update) the bookmark. In the preceding example, Data was
checked, and my slicer selections were preserved in the bookmark. This is default
behavior and without a doubt a setting you want active most of the time.
Display: Preserves the display settings you made when you first created (or when
you update) the bookmark. If Display is unchecked, any display selections you made
before switching to the bookmark are transferred to the bookmark. The easiest way to
understand this is to see two examples as shown in Figures 10-18 and 10-19.
Figure 10-18. The Default View, with Spotlight turned on for one visual
In Figure 10-18, all the slicers are set to Select All, and a single visual is
spotlighted. In Figure 10-19, the bookmark has been saved with the Display option
unchecked.
255
Chapter 10 Enhance Reports
Figure 10-19. With Display unchecked, the bookmark inherits the selections made
on the previous view of the data
Tip Understanding all the bookmark settings, and how they work, requires a
lot of trial and error (in my opinion). I suggest setting up a test page with at least
two slicers (or a slicer and a filter) and two visuals. Then save that as a Default
View bookmark. Make individual selections on the slicers and save the bookmarks
with a name indicating what you did. Then toggle back and forth between the
bookmarks to see the impact of changing the settings.
256
Chapter 10 Enhance Reports
The Selection pane is easy to use. As you can see in Figure 10-21, to make
something “invisible,” toggle the eye icon so that it has a slash through it.
One of the typical uses of making an element invisible is when using a bookmark
and a button. In the preceding example, the Return to Default View button is not
necessary, because this is the Default View. But on other bookmarks, this button should
be visible to make navigation back to the Default View easier as shown in Figure 10-22.
257
Chapter 10 Enhance Reports
As in PowerPoint, you can arrange and layer the elements on your report page. On
the Selection pane, use the Layer order to place shapes, buttons, and other visual
elements on top of each other. Use the Tab order to determine the selection sequence
when tabbing on a page.
Another similarity with PowerPoint is the Group feature. If you want to be able to
work with a group of elements as a block, you can create a group, using Format ➤ Group
as is shown in Figure 10-23. (To see the Format contextual menu, make sure that you first
select a visual. To activate the Group feature, select at least two elements on the page.)
258
Chapter 10 Enhance Reports
Figure 10-23. Select at least two visual elements to see Format ➤ Group
As soon as you create a group, it will show up as a group on the Selection pane. You
can rename this group to make it easier to identify as shown in Figure 10-24.
259
Chapter 10 Enhance Reports
A group makes it easier to apply a single action to multiple visual elements at once.
As shown in Figure 10-25, if you want to make multiple elements not visible, you can
make the group not visible.
Tip You might be familiar with the Selection pane in PowerPoint. (If not, it is
worth checking out!) As in PowerPoint, you can rename elements on your Selection
pane (as I did with the preceding group) to make them easier to select. However,
there is one “gotcha.” If you rename a visualization on the Selection pane, that
name will appear in the visualization’s title as shown in Figure 10-26. This is not
usually a desired outcome. But you can rename any page element successfully, as
long as you are not using the Title feature for the visual.
260
Chapter 10 Enhance Reports
261
Chapter 10 Enhance Reports
A Bookmark button will include a bookmark icon, but the icon alone will not be
sufficient to tell a report user what the button does. Don’t forget to add some helpful text
to the button as shown in Figure 10-28.
262
Chapter 10 Enhance Reports
Tip In an earlier chapter, I said that when you are working in the Power BI
Desktop, you are in developer mode. Some features do not work without using the
Ctrl key. Once the report is published into the Service, Ctrl is no longer required.
Tooltips
Perhaps you have reached saturation in the number of features you can use in a Power BI
report. Take a break and stretch. Maybe take a walk outside—because we have one very
rich area still to cover: tooltips.
If you have ever hovered your mouse over a data point on a visualization, you have
seen a tooltip. Figure 10-29 shows an example of a tooltip.
263
Chapter 10 Enhance Reports
As useful as the default tooltip is, it can be configured to be much richer. By default, a
tooltip displays the default values for each field used in the visualization. The first step to
enhance a tooltip is to add a field or a measure to the tooltip, as shown in Figure 10-30.
Figure 10-30. Adding a measure to the Tooltips field well for a visual
Be very judicious when adding additional measures to a visual in the Tooltips field
because every measure will require additional calculation time, which can slow down
the report’s performance. This is true even if the report user never hovers over a data
264
Chapter 10 Enhance Reports
point to see the tooltip! If your report page is slow, one reason can be too many measures
in the Tooltips field for one or more visualizations.
Tip Don’t forget that if the field or measure has a “clunky” name, you can
rename it just for the visual in question as shown in Figure 10-31.
After renaming the measure (in this case), the tooltip is more readable. You can
judge for yourself in Figure 10-32.
265
Chapter 10 Enhance Reports
But wait… There’s more! As you can see in Figure 10-33, the background and text
properties of a tooltip can be adjusted as well, under Format visual ➤ General.
However, before you change the tooltip for each visualization, remember you are
changing it for just that visualization. If you want consistency in your report (which most
people do), you will have to perform these formatting changes for all your visualizations.
Figure 10-33. Formatting tools for the background and text of a tooltip
266
Chapter 10 Enhance Reports
Tooltip Pages
A tooltip page is just what it sounds like—an entire page that shows up in a tooltip! The
setup for a tooltip page has several steps, but it isn’t hard. The first step is to create a new
page in your report and hide the page as shown in Figure 10-34. (It is rare that you will
want viewers to access your tooltip page.)
Figure 10-34. A new tooltip page, named “Tooltip Page” for clarity
Before adding anything to the report page, navigate to Format page ➤ Page
information and set the page as a tooltip page as shown in Figure 10-35. If you skip this
step, you cannot set up a tooltip page.
267
Chapter 10 Enhance Reports
If you want the tooltip to be smaller than the default tooltip canvas size, you can set
the Canvas settings to Custom and change the pixel size as shown in Figure 10-36.
268
Chapter 10 Enhance Reports
Now you can add your visualizations. Keep in mind that you are designing for a
tooltip, so be judicious about adding multiple visual elements. In Figure 10-37, I have
added a single-value card visual to display the largest order value and formatted the
visual for more impact.
Once you have the tooltip page set up, navigate back to the page and visualization
where you want this tooltip to appear. (In Figure 10-38, I have named the page “Tooltip
Page,” but this is not necessary; the page can be named anything.)
269
Chapter 10 Enhance Reports
270
Chapter 10 Enhance Reports
Not only are tooltip pages a cool concept, but they can also help improve the
performance of your report page. Unlike a garden variety tooltip, a measure used in a
tooltip page is not evaluated unless the report user hovers over the data point.
Tip For a tooltip to work, the fields (or measures) used in the visualization and
tooltip must be related in the data model.
271
Chapter 10 Enhance Reports
Once in the Mobile layout, drag your existing visuals onto the mobile canvas and
arrange them as appropriate as you can see in Figure 10-41. The grid allows you to lock
visual elements. The mobile view auto-adjusts to different devices, so you don’t need to
create separate layouts for different sizes of device.
Figure 10-41. Drag, drop, and arrange selected visuals on the mobile canvas
Once the visuals are laid out, you can adjust formatting features as needed as you
can see in Figure 10-42.
272
Chapter 10 Enhance Reports
273
CHAPTER 11
Identify Patterns
and Trends
Power BI’s purpose is to allow you to visualize your data and thereby facilitate analysis
of that data. In this chapter, I will explore several features and visualization types that are
available to make analysis both easy and comprehensive. Let’s start with the Analytics
feature.
275
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2_11
Chapter 11 Identify Patterns and Trends
276
Chapter 11 Identify Patterns and Trends
277
Chapter 11 Identify Patterns and Trends
The benefit of the Analyze feature is that it looks at all the data and the relationships
in the data model. It will surface insights that may (or may not) be useful. If you like one
of the visuals it creates, you can click the + sign in the upper right-hand corner, and the
visualization will be added to your report page as shown in Figure 11-4.
278
Chapter 11 Identify Patterns and Trends
Identifying Outliers
When analyzing data, we often want to find data points that don’t fit the dominant
pattern because that data may reveal insights about the rest of the data. The scatter
plot visualization is a very useful tool for discovering outliers. In the following example,
the data points cluster between 0.1 and 0.2 trillion dollars each month, with a few
months clearly well above the average. Depending on how narrowly the band is defined,
there will be fewer or more outliers as you can see in Figure 11-5.
279
Chapter 11 Identify Patterns and Trends
The scatter plot makes it easy to see clustering because you can add average,
median, or trend lines to make the pattern clear. On the Analytics pane, choose the type
of line you want to add to the scatter plot. In Figure 11-6, I have added an Average line.
280
Chapter 11 Identify Patterns and Trends
281
Chapter 11 Identify Patterns and Trends
Once the type of axis is changed, the visualization will change, and you will be able
to sort the years by other fields on the visual as shown in Figure 11-9.
282
Chapter 11 Identify Patterns and Trends
Most data will naturally fall definitively in one of the two types. But if you are working
with data that can be either continuous or categorical, experiment with the different
types of axes to see if one suits your analysis better than the other.
Creating Groups
Start with a column or bar visualization and then select the data points you want to
group. Select multiple data points by holding down the Shift key as you select each one
and then right-click, as shown in Figure 11-10.
283
Chapter 11 Identify Patterns and Trends
Figure 11-10. Selecting the data points for sales over 200 billion
Once the group has been created, it will appear on the Fields pane, in the same
table as the base field. In Figure 11-11, the base field is Year Month, and the group
appears in the Date table.
284
Chapter 11 Identify Patterns and Trends
Figure 11-11. A group appears in the same table as the base field
Once created, a group can be edited easily, as shown in Figure 11-12. Click the
ellipsis menu next to the group name on the Fields pane. (You can also click the
drop-down arrow next to the group if you use it in a visual.)
285
Chapter 11 Identify Patterns and Trends
In the Groups dialogue box, you can add members to a group, remove members from
a group, and rename groups. In Figure 11-13, I have renamed my two groups to make
their composition clear.
286
Chapter 11 Identify Patterns and Trends
287
Chapter 11 Identify Patterns and Trends
But wait… There’s more! You can use a group either in a slicer or on the Filters
pane, making it easy to filter multiple data points at once, as shown in Figure 11-15. To
use a group in a slicer, simply drag the group to the slicer visualization field well.
Groups can also be used on the Filters pane, with the same results. To do so,
right-click the group and choose Add to filters and then the appropriate filter area as
shown in Figure 11-16. (You can also drag the group to the Filters pane.)
288
Chapter 11 Identify Patterns and Trends
Once the group is on the Filters pane, it behaves like any other field that is acting as
a filter as shown in Figure 11-17.
289
Chapter 11 Identify Patterns and Trends
Creating Bins
Groups work well with data points created by a measure. In the preceding example,
the Total Sales field is a measure that I created. What if you want to group values in a
calculated column? It’s just as easy as creating groups (hopefully you found that easy!).
I am starting with a calculated column called Total Sales CC (to distinguish it from
the Total Sales measure). Right-click the calculated column and choose New group as
shown in Figure 11-18.
290
Chapter 11 Identify Patterns and Trends
The Bins dialogue box will open, and you can choose whether to create bins based
on the size or create bins based on a set number of bins as shown in Figures 11-19
and 11-20.
291
Chapter 11 Identify Patterns and Trends
292
Chapter 11 Identify Patterns and Trends
Once the bins have been generated, they will appear in your Fields list in the same
table as the calculated column, as you can see in Figure 11-21.
293
Chapter 11 Identify Patterns and Trends
Figure 11-21. Bins appear in the same table as the calculated column
Now you can use bins just as you would a field. In Figures 11-22 and 11-23, I want to
know how many orders are in each of the bins.
294
Chapter 11 Identify Patterns and Trends
Figure 11-22. Using a Count Distinct implicit measure with the bins
Tip If I were using the visualization shown in Figure 11-23 in a report, I would
spend more time perfecting the formatting on the X-axis!
295
Chapter 11 Identify Patterns and Trends
Clustering
The last way of grouping your data is to let Power BI do it for you with the clustering
feature.
Tip There are some very sophisticated statistical techniques for clustering. If you
want to be able to use those techniques, you should probably use R or Python and
then create a visual.
I am going to find clusters in store sales data. In Figure 11-24, I have created a table
and added the fields for Total Sales and store Name.
296
Chapter 11 Identify Patterns and Trends
Figure 11-24. Access the clustering feature from the ellipsis menu on the visual
Once Power BI has found the clusters, it will create a new field and display it on the
same visual as shown in Figure 11-25.
297
Chapter 11 Identify Patterns and Trends
Now the resulting field can be used in a slicer, on the Filters pane, or on another
visualization.
Using AI Visuals
There are several types of visualizations that use artificial intelligence to detect patterns
that may not be immediately apparent. I will cover two of these here, but I encourage you
to experiment with all the visualization types before sitting the PL-300 exam.
298
Chapter 11 Identify Patterns and Trends
Once the fields are in place, the key influencer visualization looks like
Figure 11-27.
Figure 11-27. The Music, Movies, and Audio Books drive up sales
299
Chapter 11 Identify Patterns and Trends
There is a second pane for the key influencer visualization called Top segments.
On this pane, Power BI detects groupings of data and profiles those segments as you can
see in Figure 11-28.
300
Chapter 11 Identify Patterns and Trends
Figure 11-29. The Format visual pane has functional features as well
301
Chapter 11 Identify Patterns and Trends
Once the visualization is set up, you can expand the Analyze field into its constituent
parts by choosing the + symbol as shown in Figure 11-31.
Once the Explain by fields are visible, you can select individual elements by
selecting the appropriate bar as shown in Figure 11-32.
302
Chapter 11 Identify Patterns and Trends
303
Chapter 11 Identify Patterns and Trends
304
PART V
Manage Files
and Datasets
You have created and published your report. Bravo! In Chapter 14, you will read about
how to publish and update a report once it is published in the Service. In that chapter, I
specifically say that updating the report does not include updating the data. “But wait,”
you say! Isn’t the whole point to be able to see the latest data in the report, at any time?
Yes, you are correct—having up-to-date data in the report is one of the main benefits of
using Power BI. It is time to talk about refreshing the data.
Schedule a Refresh
How often you can refresh your data automatically depends on the license you have:
Once you have published a report (and its accompanying dataset) in the Service, you
will need to schedule automated refreshes, license permitting. A refresh is set up on a
dataset, not the report itself.
307
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2_12
Chapter 12 Manage Files and Datasets
On the same line as the dataset, there are two icons that are shortcuts to the refresh
menu as shown in Figure 12-1. One is a manual refresh, and the other is a scheduled
refresh.
The Scheduled refresh is a subitem in the Settings menu (in Figure 12-2), which is
accessed through the ellipsis menu shown in the Figure 12-1.
308
Chapter 12 Manage Files and Datasets
309
Chapter 12 Manage Files and Datasets
If, when you open the Scheduled refresh menu, all the items are grayed out, that
means that the Power BI Service is not able to access the source data to perform the
refresh.
310
Chapter 12 Manage Files and Datasets
Unless you are in IT, you will probably only ever install an on-premise data gateway
in personal mode. (These used to be called personal gateways.) If you wish to install one,
you will need to download the software to do so. After installing the gateway, you can
view it under the Settings ➤ Datasets menu as shown in Figure 12-4.
As you can see in Figure 12-5, under the Settings menu, open the Gateway
connection menu.
311
Chapter 12 Manage Files and Datasets
In Figure 12-6, you can see the gateway that a dataset depends upon to perform a
refresh.
You can access the list of gateways to which you have access through the Settings ➤
Manage gateways menu, as shown in Figure 12-7.
312
Chapter 12 Manage Files and Datasets
Personal gateways are typically used to connect to datasets stored on your computer.
Personal gateways use your credentials to access the data source. Also, personal
gateways will only be active while your device is connected to the data source. If your
organization needs a gateway to enable multiple users to access data sources behind a
firewall, then one of the other two types of gateways is necessary:
313
Chapter 12 Manage Files and Datasets
314
Chapter 12 Manage Files and Datasets
Figure 12-9. Accessing the Settings ➤ Security menu for the dataset
Once you are in the Security dialogue box, you will see a list of the roles that have
been defined in the PBIX, as shown in Figure 12-10. Enter the names of individuals (or
security groups) who should be assigned these roles.
315
Chapter 12 Manage Files and Datasets
Tip Sharing with colleagues who are not members of the workspace (or
subscribed to the associated app) can lead to “security sprawl.” It is a good idea
to have very clear governance about when sharing with non-workspace members
should be allowed.
Share and build permissions are enabled on a particular dataset. To initiate the
process, go to Settings ➤ Manage permissions on the same row as the dataset as shown
in Figure 12-11.
316
Chapter 12 Manage Files and Datasets
In the Permissions dialogue box, there are two areas: Links and Direct access.
Anyone who is an Admin, Member, or Contributor in the workspace has direct access to
any dataset in the workspace, as is shown in Figure 12-12.
Figure 12-12. Workspace members have share and build permissions by default
317
Chapter 12 Manage Files and Datasets
To grant someone either share or build permissions, choose Direct access ➤ Add
user. Then type in the name of the person to whom you are granting permissions and
check the appropriate boxes, as shown in Figure 12-13.
Access can also be granted using generated links, much as you do in OneDrive. To
share using a link, you must first select the report, not the dataset. Then you can choose
Add link as shown in Figure 12-14.
318
Chapter 12 Manage Files and Datasets
As shown in Figure 12-15, you can adjust who can use the link and set whether the
link will allow sharing of the report and/or using the underlying dataset to build new
reports.
319
Chapter 12 Manage Files and Datasets
Once the link is created, it will show up under Links, and it will list the permissions it
grants, as you can see in Figure 12-16.
320
Chapter 12 Manage Files and Datasets
If you need to delete the link, or adjust the associated permissions, use the ellipsis
menu to display these options as shown in Figure 12-17.
321
CHAPTER 13
Create Dashboards
When students introduce themselves in my classes, I ask them to tell me what they want
to learn. Invariably, I will hear that they are using dashboards and they want to learn
how to create one. When I dig a little deeper, it often turns out that they are using reports,
not dashboards. Now that we are close to the end of this book, I hope that it is clear that
dashboards and reports are two different things. So far, we have focused on reports. This
chapter is dedicated to dashboards.
Creating a Dashboard
If reports and dashboards are different, what is a dashboard? A dashboard
323
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2_13
Chapter 13 Create Dashboards
In a previous working life, I was a facilities manager. After the 9/11 events, I was
asked to put up large TV monitors in common areas, for example, the lobby, the break
rooms, and the cafeteria. (You may have noticed this in your own office.) The perfect
application for a dashboard is to be displayed on these monitors. They are usually
mounted high on a wall, so no one expects to interact with the dashboards. The data
is being displayed for information, not investigation. Setting users’ expectations
appropriately can reduce their frustration with the mechanics of dashboards.
Creating a Dashboard
Setting up a dashboard is easy. Starting from a report, find a visualization you want to
include on a dashboard and pin it, using the pushpin icon in the visualization’s header,
as you can see in Figure 13-1. (If you don’t see a header above the visualization, it may be
hidden by the report creator.)
The Service will ask you if you want to add the visualization to an existing dashboard
or create a new one, as you can see in Figure 13-2.
324
Chapter 13 Create Dashboards
Immediately after choosing the dashboard, you will see a pop-up menu (Figure 13-3)
that allows you to go to the dashboard.
Figure 13-3. This pop-up menu only stays up for a short time
325
Chapter 13 Create Dashboards
If you miss the pop-up window, there are several ways to navigate to the dashboard.
The first way is to use the “breadcrumbs” at the top of the screen, as you can see in
Figure 13-4. This will take you back to the main page of the workspace. From there, you
can pick the dashboard you created (or added to).
The other way to find your dashboard, or any other content, is to use the navigation
on the left side of the screen as shown in Figure 13-5. From there, you can find the
content organized into groups.
326
Chapter 13 Create Dashboards
Once you have navigated to the dashboard, you can see the visualizations you have
pinned. A sample dashboard is shown in Figure 13-6. If you are at all familiar with the
AdventureWorks data, you will notice that in Figure 13-6, there are clearly visuals from
more than one report (and dataset). Dashboards can contain content from multiple
reports.
327
Chapter 13 Create Dashboards
Streaming Data
Unlike reports, dashboards support live or streaming content. It is easy to add a tile
for streaming data or a YouTube video channel. As shown in Figure 13-7, choose Add
a tile in the Edit menu. You will then see the Add a tile dialogue box, as shown in
Figure 13-8.
328
Chapter 13 Create Dashboards
Figure 13-8. Adding a tile with live data (or an image or a text box)
Dashboard Themes
The built-in creative options with a dashboard are very limited. You can change the
theme from light to dark or color-blind-friendly. If you need more formatting options,
the best option is to upload a JSON theme you have created, as shown in Figure 13-9.
329
Chapter 13 Create Dashboards
Editing a Tile
I have been referring to the elements added to dashboards as visualizations, because
that is what they are. However, once they are placed on a dashboard, they are called tiles.
Can you edit a tile? Yes, to a limited extent. (To change the source visualization, you will
need to return to the report, either in the Service or, preferably, in the Power BI Desktop.)
Click the ellipsis menu in the upper right-hand corner, and you will see the edit
options, as shown in Figure 13-10.
330
Chapter 13 Create Dashboards
Most of the options are straightforward, but there are a couple worth exploring.
Export to .csv
If you want to see the data underlying this particular tile, choose Export to .csv.
(Unlike in the Power BI Desktop, there is no option to view the data as a table.) In
Figure 13-11 you can see the result of exporting data underlying a visual to Excel.
331
Chapter 13 Create Dashboards
View Insights
In a previous chapter, we reviewed various ways that the underlying AI capabilities can
be used to find relationships and patterns in the data that you may not be able to surface
easily. This capability is also built into dashboards. If you want to generate insights from
just the data underlying a specific tile, choose View insights. If there are any insights,
Power BI will generate new visuals to represent them. If one (or more) is useful, you can
pin it to your dashboard using the pushpin icon, as shown in Figure 13-12.
332
Chapter 13 Create Dashboards
Pin Tile
This option may seem odd—isn’t this visualization already pinned? Yes, but what if you
want to pin it to another dashboard? Nothing easier.
As I mentioned at the beginning of the chapter, some users are disappointed
when viewing dashboards, because the tiles do not interact with each other. Upon
consideration, this is only to be expected, as visuals can come from multiple reports and
different datasets. If you click a tile, you will return to the source report. But there is one
way to achieve interactions between tiles on a dashboard: pin an entire report page.
333
Chapter 13 Create Dashboards
Once the page has been pinned, you can tell that it is a live page in two ways. The
visualizations will interact (just as they do on a report page), and the name of the
report and the page number will appear in the upper left-hand corner, as shown in
Figure 13-14.
Figure 13-14. A live page has the report name in the upper left-hand corner
Think carefully before pinning a live page to a dashboard. Can the users benefit from
simply using the source report? Dashboards and reports are not the same thing and
shouldn’t be used interchangeably. Can the report be simplified and shared with users
via the app?
334
Chapter 13 Create Dashboards
You can rename the dashboard and add a contact for the dashboard. There are
additional controls in the menu, as shown in Figure 13-16.
335
Chapter 13 Create Dashboards
We will be talking about Q&A in the following. The Dashboard tile flow automatically
rearranges the tiles if a tile is added or deleted.
336
Chapter 13 Create Dashboards
337
Chapter 13 Create Dashboards
As you can see in Figure 13-19, in the Settings sub-menu, you will find an entry
for Q&A.
338
Chapter 13 Create Dashboards
Now that Q&A is enabled, you can take advantage of it on a dashboard and on
a report.
At the top of a dashboard, there will be a line where you can type in a question using
natural language as shown in Figure 13-20.
As soon as you click into the Q&A area on the dashboard, a new window will open
where you can type in your own question or choose a suggested question from those
offered, shown in Figure 13-21. (You can set up suggested questions in the Power BI
Desktop.)
339
Chapter 13 Create Dashboards
As shown in Figure 13-22, after typing in a question or choosing one of the suggested
questions, Q&A will generate a visualization.
If you like the visualization that Q&A produces, you can pin it to the dashboard as
shown in Figure 13-23.
Refreshing a Dashboard
The data that underpins the visualizations will be updated by the refresh schedule
you set up for a dataset. If the visualizations are changed, you will need to refresh the
dashboard to reflect those changes. This is easy. Choose the refresh icon in the upper
right-hand corner of the dashboard, as shown in Figure 13-24.
340
Chapter 13 Create Dashboards
341
CHAPTER 14
Manage Workspaces
in the Service
Your report is done, and you want to share it with colleagues and, possibly, a wider
audience within your organization. It can be tempting to email your PBIX (a Power
BI Desktop file), but you will quickly find this method of sharing less than optimal,
to say the least. PBIX files can be very large, and many email servers will block them.
Additionally, there are features of your report that will not work properly unless the
report is published to the Power BI Service. So what do you do? You publish your report
to a specific workspace in the Power BI Service. Not sure what that means? Read on.
4. Publish.
Figure 14-1. Sign into the Power BI Service using your credentials
When you have successfully signed in, your name will appear in the upper right-
hand corner. If you need to sign out and sign in with different credentials, you can do so
readily, as you can see in Figure 14-2.
Now that you are signed in, you are ready to publish your report to a workspace in
the Service.
344
Chapter 14 Manage Workspaces in the Service
• My workspace
• Workspaces
Once the report is published, you can keep working in the Power BI Desktop or go
directly to the report in the Service by following the link in the Publishing to Power BI
dialogue box, as shown in Figure 14-4.
1) Follow the hyperlink for your report after you have published it
(see Figure 14-4).
2) Log in to Office 365 and use the App Launcher to navigate to your
apps, as shown in Figure 14-5. (If the icon for the Power BI Service
isn’t present, hit All apps.)
346
Chapter 14 Manage Workspaces in the Service
Figure 14-5. Find Power BI in the list of your apps in Office 365
As shown in Figure 14-6, you can tell you are there once you see the App Launcher
and Power BI in the upper left-hand corner.
347
Chapter 14 Manage Workspaces in the Service
Figure 14-6. From the Power BI Service, you can go to other places in Office 365
348
Chapter 14 Manage Workspaces in the Service
Home: Frequently accessed reports and dashboards, recent files, favorited files.
Everybody’s Home screen will vary based on your organizational settings and your use of
the Power BI Service.
Create: Initiate the creation of a report in the Service. Note that you will have to use a
previously published dataset.
Browse: Browse the contents of the Service.
Data hub: Lists all the datasets published and available to you in the Service.
Apps: Where all the apps to which you have access are listed. You may have to hit Get
apps to find an app initially.
Learn: One-stop shop for finding additional learning resources.
349
Chapter 14 Manage Workspaces in the Service
350
Chapter 14 Manage Workspaces in the Service
As shown in Figure 14-10, you can also filter the view even further by using the
Filters menu.
351
Chapter 14 Manage Workspaces in the Service
Next to the Filters tab is the Access tab (Figure 14-11). This is where individuals,
and/or security groups, can be added to the workspace. There are four levels of access:
• Admin: This is the highest level of privilege. Someone with Admin
rights can delete the workspace. It is a good idea to have at least two
people with Admin rights in the workspace.
352
Chapter 14 Manage Workspaces in the Service
• Member: Members can add, edit, and delete content. They can also
add other people to the workspace. They can publish, edit, and
unpublish the app associated with the workspace.
• Viewer: Viewers can only view content. They have no other rights.
Governance
Because three of the four access levels allow the editing of any content in the workspace,
establishing governance practices is very important. Anyone with Admin, Member, or
Contributor access needs to follow agreed-upon practices to ensure that unintentional
changes do not occur.
353
Chapter 14 Manage Workspaces in the Service
Creating a Workspace
You may have the right to create a workspace if your Power BI Admin (usually someone
in IT) has allowed this configuration. If you do, you will see Create a workspace, as
shown in Figure 14-12.
354
Chapter 14 Manage Workspaces in the Service
Tip Before creating a workspace, it is best to have a clear idea of both the purpose
of the workspace and the intended audience (if any) of the reports and dashboards.
This is because, as of this writing, there is only one app allowed per workspace.
Recently, Microsoft has added the ability to define multiple audiences for a single app,
which does help. Your workspace still can only have one app, but different content
within the same app can be viewed by different audiences. This is a relatively new
feature (as of this writing), so you may not see it implemented in your workspace yet.
Premium Capacity
There is a Premium license that allows an organization to purchase dedicated server
capacity in which to house some of their workspaces. Premium capacity provides more
features and functionality:
• Paginated reports.
If a workspace resides in Premium capacity, it will have a diamond icon next to it.
355
Chapter 14 Manage Workspaces in the Service
A report that is created in the Service must use a preexisting data model. No
additional content (e.g., columns, measures) can be added to the report in the Service.
356
Chapter 14 Manage Workspaces in the Service
357
Chapter 14 Manage Workspaces in the Service
Updating a Report
Once a report is published, imported, or created within the Service, the question of
updating will eventually arise. Not the data, of course; that is taken care of when you
establish the refresh schedule. But what happens when a visual needs to be added,
deleted, or changed? You can edit the report in the Service, but this option should be
exercised with significant caution.
If a report is updated in the Power BI Desktop and republished to the Service, it will
overwrite the version of the Power BI report saved in the Service. This is by design—you
want to make sure that the latest version of the report is what is available in the Service.
This means that if a change is made in the Service, it will be overwritten when a new
version of the report is published, unless the change is replicated in the Power BI Desktop.
These are either/or conditions—you can’t share the same app to a specific group of
people and with the organization.
I think of an app as a magazine or newsletter. Someone decides what content is going
to be included, and then the app is updated on a periodic basis (daily, weekly, monthly,
quarterly). The great thing about using the app as a sharing vehicle is that app viewers
1
At the time of writing, Microsoft has just released a new way of sharing apps. Because these
features are not fixed in stone (yet), the PL-300 exam will probably not have questions on this new
set of features. However, I strongly urge you to go to Microsoft docs and familiarize yourself with
the new methods for organizing apps.
358
Chapter 14 Manage Workspaces in the Service
do not see the working copy of the content. If a report is published in the app (e.g., in
January), viewers will only see the January version of that report until the app is updated.
To designate content that should be included in the app, toggle the Include in app to
Yes, as shown in Figure 14-15.
Note Microsoft has released a newer set of features for apps, which allow for the
designation of different audiences for content in the app. The screenshots below
pertain to V1 Apps, not to V2 Apps.
359
Chapter 14 Manage Workspaces in the Service
Creating an App
As I mentioned earlier, a workspace can only have one app, which means that it is
important to think about the intended audience for the content of the workspace, when
you set up the workspace. There are three stages for creating an app2:
• Description (mandatory)
2
Again, I strongly encourage you to read the latest documentation provided by Microsoft, as these
setup steps, and indeed the way the screens look, are changing.
360
Chapter 14 Manage Workspaces in the Service
361
Chapter 14 Manage Workspaces in the Service
Once you have established sections, you can designate content for each section, as
shown in Figure 14-18. Content does not have to be included in a section and can be
hidden from Navigation if needed.
362
Chapter 14 Manage Workspaces in the Service
• Pushing the app: You can “push” the app to all authorized viewers,
which saves them the step of going to Get apps and “pulling” the app.
363
Chapter 14 Manage Workspaces in the Service
If, after creating the app, you need to change the settings, click Update app. The
Settings menu will open, and you can alter settings as needed.
Deleting an App
If an app is no longer needed you can delete it, if you are an Admin or Member of the
workspace.
Figure 14-20. The Sensitivity tile is available when the feature is enabled
Once the report is published, the appropriate data label will be indicated in the
workspace, as you can see in Figure 14-21.
364
Chapter 14 Manage Workspaces in the Service
Figure 14-21. The Sensitivity label is reflected once the report is published
Tip It is important to know that as a Power BI user, you do not have control over
whether data sensitivity labels are available or not.
• Datasets
• Dataflows
• Apps
When you promote something, it is akin to signing your name to your work. I would
suggest establishing criteria for content worthy of promotion.
365
Chapter 14 Manage Workspaces in the Service
Certifying Content
Certification is more a process than a technical feature. Prior to enabling the certification
feature, your organization needs to determine what criteria constitute content worthy of
certification. Some considerations could include
What your organization considers worthy of certification will differ from another
organization’s criteria. Once the criteria have been established, the policy needs to be
written, and the accompanying process needs to be designed and implemented. Only
after these steps are complete should the certification feature be implemented within
Power BI. As a user, you don’t have any control on whether the certification option is
available—that is up to the Power BI Admin. Once it is, only selected individuals will be
able to certify content.
366
PART VI
Where Do You Go
from Here?
Congratulations! If you have made it this far in the book, my hope is that you are ready to
sit the PL-300 exam. But remember what I said in the first chapter? I want you to be ready
to work with Power BI. How can you continue your growth?
The good news is that there are a lot of resources available to you, many of them free.
The bad news? There are a lot of resources available, but you have to discover them. In
this chapter I am going to provide you with my favorite resources. Please note that
YouTube
Let’s start with YouTube, which is where the lion’s share of the resources is.
Guy in a Cube
This is the channel where I started my learning journey. Adam Saxton and Patrick
LeBlanc (who both work for Microsoft) have been creating videos since 2017, so the
library of videos is extensive. One of the things I love about their channel is that their
content runs the gamut from beginner to complex topics. No matter the stage you are in,
you will find helpful, relevant material on this channel.
369
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2_15
Chapter 15 Where Do You Go from Here?
Guy in a Cube (GIAC) provides a bonus offering: they hold a one-hour live session
most Saturdays at 9:30 a.m. Eastern, which is open to anyone. Attendees are from all over
the world, and, if you attend regularly, you will get to know some Power BI heavy hitters
by name. Adam and Patrick take questions from participants and answer them. If you
choose to join as a member, you can pre-submit questions.
Ruth Curbal
Ruth’s channel is wonderful because she produces videos that cover the entire Power
BI spectrum. You will find videos on DAX, the Power Query Editor, and the Service. Her
style is very approachable and easy to follow. She also has fun contests and events, such
as the “25 Days of DAX,” which she ran in December 2021. You can’t go wrong following
Ruth’s channel.
RADACAD
Reza Rad is Power BI royalty in the Power BI community. In addition to the extensive
content he produces, he also runs conferences that are affordable and well worth your
time and money.
SQLBI
No list of YouTube channels (or blogs) would be complete without talking about SQLBI,
run by Marco Russo and Alberto Ferrrari (colloquially known as “the Italians” in the
Power BI community). There are so many good resources I don’t quite know where
to begin.
370
Chapter 15 Where Do You Go from Here?
Chris Wagner
Chris Wagner’s YouTube channel is my go-to when I want to tackle some more technical
concepts. He does a great job of explaining difficult concepts clearly. He has a wealth
of knowledge and experience in implementing, maintaining, and governing Power BI
within a large enterprise. Not to mention he has a great sense of fun!
Two Alex
For a while, Alex Powers and Alex Dupler ran a Saturday morning live stream right after
Guy in a Cube. I loved this channel because they would go deep into some technical
concepts. While there aren’t a lot of videos on this channel, every one of them is worth
watching.
Explicit Measures
Mike Carlo, Tommy Puglia, and Seth Bauer host a twice-weekly podcast called
“Explicit Measures.” I love this podcast because they cover real-world topics in a very
approachable way. I can’t recommend them enough!
371
Chapter 15 Where Do You Go from Here?
Blogs
There are so many good blogs out there it is very hard to confine myself to just a few.
SQLBI
As I mentioned earlier, Marco Russo and Alberto Ferrari post articles that accompany the
videos they post on YouTube. I am someone who learns by reading, so having an article
to read really helps me solidify a concept. I often will watch the YouTube video, then read
the article, and then rewatch the video.
I would mislead you if I said that their posts are for beginners, but it is never too early
to expose yourself to DAX concepts. You will be amazed by how much you retain. And,
over time, it all begins to “click.”
Chris Webb
Chris’ blog focuses on the Power Query Editor. I love it because he often delves into
complex topics that I don’t even know how to find through a search. Often his topics are
above my head, but that gives me the motivation to dig deeper and learn more.
Ben Gribaudo
Are the Power Query Editor and the M language “black boxes” to you? I just took a class
with Ben (see “Paid Training” in the following) because I had lots of questions about
both. The class was very enlightening. But you can benefit from Ben’s knowledge at no
cost by reading his blog. He has a Power Query Editor Primer series that is a great place
to start. He also regularly blogs about much more complex topics. Even if some of them
are too complex for me, they inspire me to dig deeper.
Paul Turley
Paul Turley wrote one of the best blog series I have ever read: Doing Power BI the Right
Way. If you don’t explore any of the other blogs I mention, be sure to read this series. I
recently met up with Paul, and, at the time of this writing, he is actively thinking about
new topics for his blog page—I can’t wait for his new content to drop.
372
Chapter 15 Where Do You Go from Here?
Books
Sometimes it seems to me that no one uses books for learning anymore, but I love them.
(Hopefully this book will be the exception to this trend!) There are several books that I
rely on heavily.
373
Chapter 15 Where Do You Go from Here?
Paid Training
Once you are beyond the basics, there are several paid training courses that I can highly
recommend.
User Groups
The pandemic was terrible on many levels. One of the few benefits to come from it is
the move to online meetings by most user groups. You can now attend a user group
anywhere in the world from the comfort of your chair. Even better, most user groups
record their events and make them accessible on YouTube. Some of my favorites are
• Stuttgart
374
Chapter 15 Where Do You Go from Here?
• Romania
• London
• Azerbaijan/Baku
But this is by no means an inclusive list. You should explore and find your favorites.
Conferences
At the time I am writing this, conferences are back. There are a lot of different options,
but they vary from year to year. Twitter is a great place to hear about them. The biggest
one, “Ignite” hosted by Microsoft, has not yet returned in person but is available online.
Most conferences have a virtual option now.
I love going to conferences because I get to meet Power BI folks I only talked to
virtually. I also love sessions that are a stretch for me. I always make sure that I attend at
least two to three of these sessions.
Tip Don’t be afraid to introduce yourself to the speaker. Most of us love to meet
new people, and we welcome your questions. We want to see others succeed—we
wouldn’t be spending our time and money speaking if we didn’t!
Social Media
Twitter
By far and away, Twitter is the platform preferred by Power BI folks. Do you have a
question? Do you have an insight or an opinion? Twitter is the place to post. Some good
hashtags to follow are #PowerBI, #PowerQueryEditor, and #PowerBIHelp.
Reddit
There is an active Power BI subreddit where you can post questions and get help. There
are some heavy hitters in that group.
375
Chapter 15 Where Do You Go from Here?
LinkedIn
It is a good idea to expand your network with Power BI professionals on LinkedIn. You
can start by connecting with me at www.linkedin.com/in/jessicabjolly/. The Power
BI community is welcoming and generous. As you grow your career, you will find plenty
of people who want to help you succeed.
External Tools
Once you have gained a modicum of skills in Power BI, you will want to explore some of
the external tools that will make your job easier. I have listed a few of these tools in the
following, but you can find a complete list at www.sqlbi.com/tools/. Once you have
downloaded the program, the next time you open the Power BI Desktop, a new tab will
appear called External Tools.
DAX Studio
DAX Studio enables you to write and test your DAX. You can connect it directly to your
model and then evaluate different permutations of particular DAX expressions. In
several places in this book, I mentioned that there are always ways to improve your DAX
performance. DAX Studio helps you do this because you can measure how long a DAX
expression takes to evaluate and analyze what components are taking the longest. Once
you have fine-tuned the expression, you can then copy it back into the Power BI Desktop.
DAX Studio is free, which is incredible given the value it adds to the development
experience. And there is a bonus: Marco and Alberto have posted a free video sequence
explaining how to use DAX Studio on their You Tube channel and on their website.
Bravo
Bravo is a new tool (March of 2022) that SQLBI has introduced. It can analyze your
model, format your DAX, and create a date table for you. I have not had a chance to play
with it, but any tool created by SQLBI is well worth exploring.
376
Chapter 15 Where Do You Go from Here?
Tabular Editor
Building a data model is a nontrivial exercise. While you can do this in the Power BI
Desktop, most developers are now using Tabular Editor, a tool developed by Daniel
Otykier. There are two versions of Tabular Editor: the community version, which is free,
and the paid version, which is approximately 350 USD/year. Please be sure to check the
website (https://tabulareditor.com/) for exact pricing.
Both versions allow you to perform modeling steps more conveniently than in
the Power BI Desktop. Additionally, Tabular Editor supports some features that the
Power BI Desktop does not. With a free community version available, you can afford to
check it out!
Other Tools
The SQLBI website maintains a comprehensive list of all the external tools available for
Power BI developers (www.sqlbi.com/tools/). Be sure to check out the list as there are
many other cool tools to investigate.
Conclusion
I have had a lot of fun writing this book. It has cemented some of my knowledge of topics
that were a little “fuzzy,” and it has caused me to think deeply about what someone
needs to know to get started in Power BI. I wanted to give you an in-depth guide to the
topics you will need to study for the PL-300, but I also wanted to get you started on the
road to becoming a Power BI “ninja.” I hope that I have accomplished both goals. Most
importantly, I hope that this book helps you learn to love Power BI as much as I do!
377
Index
A Blogs
Ben Gribaudo, 372
Acceptable forms of ID, 5
Chris Webb, 372
Access levels, 353
Paul Turley, 372
Advanced Editor, 53, 92–94
SQLBI, 372
AdventureWorks DW, 18
Bookmarks
AI visualization
bookmark navigator button, 253
decomposition tree
Bookmarks pane, 250
visualization, 301–304
and buttons, 261–263
key influencer visualization, 299–301
Default View bookmark, 252
Analysis Services source, 34
elements
Analytics features, 275
Group feature, 258, 259
Analytics pane, 275–277, 280
invisible, 257
Analyze feature, 277–279
visible, 257, 258
App creation
ellipsis menu, 254
access controls, 363
group
stages
feature, 258
designate content, 362
not visible, 260
navigation, 362
renaming, 259
permissions, 363
PowerPoint, 258, 260
setup, 360, 361
renaming, 251
Append Queries
report user, 252
multiple queries into new one, 78
selection/capture, 250, 251
new query, 77, 78
Selection pane, 256, 257, 260
Apps, 16, 17, 346, 349, 363, 365
settings
Automated refresh, 307, 310
data, 255
default view, 255
B display, 255, 256
BAK file, 18, 19 nuances, 255
Bidirectional relationship, 110–112, 123 test page, 256
Bins, 290–295 updation, 252
379
© Jessica Jolly 2023
J. Jolly, Microsoft Power BI Data Analyst Certification Companion, Certification Study Companion Series,
https://doi.org/10.1007/978-1-4842-9013-2
INDEX
380
INDEX
D multilayer security
access credentials, 144
Dashboards, 14, 15, 17, 140, 195, 351
row-level security, 145, 146
creation
performance factors, 191
choosing, 325
in Power BI Desktop, 125
pop-up menu, 325
powerhouses, 186
visualization, 324, 327
queries, 188, 189
workspace, 326
remediation methods, 191
definition, 323
syntax rules, 155
editing, 327
tables/columns, 156, 157
managing tiles, 334–336
testing, 157
Mobile View configuration, 336
UseRelationship, 121
monitors, 324
pinning live pages, 333, 334 uses, 153
purpose, 323 visuals, page, 190
refreshing, 340, 341 Database credential, 19, 26
streaming data, 328, 329 Data extraction, 23
themes, 329, 330 Dataflow, 36, 37, 351, 365
tile editing, 330–334 Data model, 101
Dashboard tile, 336 data table
Data Analysis Expressions (DAX), 17 active relationships, 121
behavior, 154 date column, 117, 119
calculated columns, 128–131 date fields, 115, 116
calculated tables, 127, 128 DAX, 117
performance analyzer, 187, 188 dimension tables, 116, 117, 121
filter/row contexts, 186 fact table, 115
functions, 176 inactive relationships, 121, 122
IntelliSense, 155–157 1-many relationship, 121
masters, 176 marking, 117, 118
measures, 157 month column, 117
model refinement Power BI, 117, 119
categorization, 139, 140 Power Query Editor, 117
default summarization, 137, 138 role-playing dimensions, 123
helper fields, 135 shadow, 119, 120
hiding fields, 134, 136 sort column, 117
hierarchies, 131–134 logical combination, 101
Q&A functionality, 140, 141 Power BI, 101
Q&A preparation, 141–143 Data modeling, 101, 109, 111, 374
summarization, 136, 137 Data quality and distribution, 59–61
381
INDEX
F K
Failed exams, 12 Key influencer visualization, 299–301
Filter context, 158–161, 163, 164, 167, 168, Keys and IDs, 62–64
179, 180, 185
Foreign key, 63
Formula Bar, 49, 89, 92, 94, 126, 153, 155 L
Free license, 16, 17, 307 Languages, 17, 68, 125, 153, 339
Future-proofing, 89, 373 Layman’s terms, 4
Line visualization, 275, 277
LinkedIn, 11, 376
G Live Connection, 34, 37
Gateway connections Local dataset, 38
accessing, 312, 313 Locale, 65
list, workspace, 314
on-premise data gateway, 311
refresh, 312 M
Settings menu, 311 Manual refresh, 307, 308, 345
sub-menu, 312 Many-to-many relationships
types, 310 (Many-Many), 106, 107, 111, 191
Geographic data, 113, 139 MCID, 11
Groups, 101, 281, 283–289 Measures, 153
Guy in a Cube (GIAC), 370 All_Sales, 154
analyzing, 154
calculated column, 153, 155
H entering, 153, 154
Havens Consulting (Reid Havens), 370 explicit measures
Hierarchies, 131–134, 184, 185, 242, hidden column, 173
243, 245 results, 171, 172
Home tab, 23, 24, 48, 63, 92, 145 summarization, 172, 173
functions, 154
implicit measures
I, J results, 171, 172
Import mode, 32 summarization, 170, 171
Incremental refresh, 45 LineTotal, 154
Iterator functions, 155, 168, 169 Quick measures
383
INDEX
Measures (cont.) N
creation, 174, 175
Native key, 64
menu, 173, 174
Navigator dialogue box, 24, 25
table, 176
Northwind, 18
report creators, 173
semi-additive measures
bank balance, 180 O
columns, 185 Object-level security, 151
DAX, 184 One-to-many relationship
functions, 180, 182, 183 (1-Many), 103–105
HASONEVALUE, 183 One-to-one (1-1) relationship, 107
inventory balances, 180 Online testing, 7, 8
ISINSCOPE, 183 Organizational data sources, 30
logical test, 183 Outliers identification, 279–281
non-totaling calculations, 181
performance, 184, 185
turn off subtotals, 181, 182 P
Merging queries Page elements
appending, 78 buttons
full anti join, 81 Action feature, 232, 233
full outer join, 80 Drill through, 233, 234
inner join, 80 instructional text, 234, 235
left anti join, 80, 81 menu, 231, 232
left outer join, 79 navigation, 237, 238
right anti join, 81 placing, 233
right outer join, 79 states, 235, 236
M functions, 17 types, 231
Microsoft certification, 11 images/shapes, 230
Microsoft certification test, 3 text boxes, 231
Microsoft Certified Trainer (MCT), 3 Paid training courses, 374, 375
M Language, 17, 47, 53, 372 Parameters
Mobility change parameter value, PQE, 43
Mobile layout, 271, 272 definition, 40, 41
visualizations, 272, 273 Edit parameters, 44, 45
visuals, mobile canvas, 272 file paths, 42
M Script, 92–95, 97 incremental refresh, 45
My workspace, 16, 17, 345, 350 manage parameters, 41
384
INDEX
385
INDEX
386
INDEX
387
INDEX
T Tooltip pages
create/hide page, 267
Tables
data model, 271
active/inactive relationships, 108
display size, 268, 269
connections, 101
formatting, 269
dimension tables, 102
results, 270, 271
disconnected tables, 108
setting, 267, 268
fact tables, 102
visualization, 269, 270
Power BI Desktop, 101
Tooltips, 263, 264
types, 102
adding measure, 264
Tabular Editor, 151, 377
formatting tools, 266
Take the exam
readable, 265
calendar markup, 8
renaming, 265
cancel/reschedule exam, 8, 9
report user, 264
exam format, 9, 10
uses, 264
general tips, 10, 11
Top segments, 300
online, 6–8
Total Sales CC, 290
signing up, 5, 6
Transformations, 33, 36, 39, 47–49, 52, 64,
at testing center, 6–8
67, 69, 82, 85, 89, 101, 201
time block, 8
Transform data, 25, 48, 97, 373
Testing center, 6–9
Twitter, 375
Tile editing
Types of exam takers, 4
ellipsis menu, 330
Export to .csv, 331, 332
pin tile, 333 U
View insights, 332, 333
Unacceptable forms, identification, 5
visualizations, 330
Unplugged series, 371
Time intelligence functions, 177
UserPrincipalName function, 146
date table, 177
User Principal Name (UPN), 148, 149
filter context, 179
PARALLELPERIOD function, 179, 180
year-to-date (YTD) sales, 177–179 V
Tools in Power BI Vertipaq, 112, 127
languages, 17 Videos library, 369
license, 17 Visualizations
Power BI Desktop, 13–15 configuration, 206, 207
PQE, 15 definition, 201
Service, 16, 17 menu, 201
388
INDEX
389