Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,000 --> 00:00:01,000
Instructor: One of Power BI's biggest
2
00:00:01,000 --> 00:00:05,000
and arguably most impactful updates of 2023
3
00:00:05,000 --> 00:00:07,000
was the new card visual.
4
00:00:07,000 --> 00:00:11,000
Now, the new card was introduced in preview in June 2023,
5
00:00:11,000 --> 00:00:13,000
and the release was pretty big.
6
00:00:13,000 --> 00:00:14,000
It gave you the ability to add
7
00:00:14,000 --> 00:00:18,000
and format multiple fields within a single card visual
8
00:00:18,000 --> 00:00:21,000
so that you could turn individual cards like this
9
00:00:21,000 --> 00:00:24,000
into a single native visual like this.
10
00:00:24,000 --> 00:00:28,000
It also added some brand new functionality like tool tips
11
00:00:28,000 --> 00:00:30,000
and drill throughs along with new styling
12
00:00:30,000 --> 00:00:34,000
and layout options, plus the addition of things like images
13
00:00:34,000 --> 00:00:35,000
and accent bars.
14
00:00:35,000 --> 00:00:37,000
So that was pretty great.
15
00:00:37,000 --> 00:00:40,000
But in the November 2023 update,
16
00:00:40,000 --> 00:00:43,000
they added some brand new functionality to these new cards,
17
00:00:43,000 --> 00:00:45,000
specifically reference labels.
18
00:00:45,000 --> 00:00:49,000
So reference labels allow you to build cards like this,
19
00:00:49,000 --> 00:00:52,000
which can include additional metrics
20
00:00:52,000 --> 00:00:55,000
like last month, forecast, et cetera.
21
00:00:55,000 --> 00:00:58,000
You can add detail text to call out things like percent
22
00:00:58,000 --> 00:00:59,000
or volume change
23
00:00:59,000 --> 00:01:03,000
and add conditional formatting to draw attention to positive
24
00:01:03,000 --> 00:01:04,000
or negative trends.
25
00:01:04,000 --> 00:01:06,000
So in this demo, I'm gonna show you
26
00:01:06,000 --> 00:01:09,000
how you can make the most of these new card visuals
27
00:01:09,000 --> 00:01:11,000
and as a bonus, I'll also show you
28
00:01:11,000 --> 00:01:15,000
how to use scalable vector graphics, or SVGs,
29
00:01:15,000 --> 00:01:19,000
with custom embedded visuals like this sparkline here.
30
00:01:19,000 --> 00:01:22,000
So here we're looking at our AdventureWorks report,
31
00:01:22,000 --> 00:01:25,000
and you remember with these cards at the top
32
00:01:25,000 --> 00:01:27,000
of our exec dashboard, we kind of had to do this manually.
33
00:01:27,000 --> 00:01:30,000
We added four separate card visuals.
34
00:01:30,000 --> 00:01:32,000
We added shapes for the background,
35
00:01:32,000 --> 00:01:33,000
we grouped it all together.
36
00:01:33,000 --> 00:01:34,000
So the first thing I wanna show you
37
00:01:34,000 --> 00:01:36,000
is how the new card visual
38
00:01:36,000 --> 00:01:40,000
can really help replicate something like this.
39
00:01:40,000 --> 00:01:42,000
So I'm gonna add a new tab here.
40
00:01:42,000 --> 00:01:44,000
I'm gonna call it New Card Demo.
41
00:01:44,000 --> 00:01:47,000
And let's go ahead and insert a new card visual.
42
00:01:47,000 --> 00:01:49,000
It looks just like the old card visual,
43
00:01:49,000 --> 00:01:52,000
except has a lightning bolt in preview mode.
44
00:01:52,000 --> 00:01:55,000
If you don't see this, head to your options.
45
00:01:55,000 --> 00:01:57,000
Make sure to check that box in the preview settings
46
00:01:57,000 --> 00:01:59,000
for the new card visual.
47
00:01:59,000 --> 00:02:02,000
So go ahead and drop that onto the canvas,
48
00:02:02,000 --> 00:02:04,000
stretch it out a little bit.
49
00:02:04,000 --> 00:02:05,000
In this case, we're just gonna drop the fields
50
00:02:05,000 --> 00:02:07,000
that we need into the data pane.
51
00:02:07,000 --> 00:02:09,000
And let's go ahead
52
00:02:09,000 --> 00:02:12,000
and just replicate what we had in that exec dashboard view.
53
00:02:12,000 --> 00:02:16,000
So we had total revenue, we had total profits,
54
00:02:17,000 --> 00:02:18,000
we had total orders,
55
00:02:20,000 --> 00:02:22,000
and we had return rates.
56
00:02:24,000 --> 00:02:25,000
And check it out.
57
00:02:25,000 --> 00:02:26,000
Already we've got all four
58
00:02:26,000 --> 00:02:30,000
of those metrics contained within one single visual
59
00:02:30,000 --> 00:02:31,000
instead of four.
60
00:02:31,000 --> 00:02:32,000
Now let's talk about
61
00:02:32,000 --> 00:02:34,000
how we can start formatting this visual.
62
00:02:34,000 --> 00:02:36,000
I'm gonna fire up my formatting pane here
63
00:02:36,000 --> 00:02:39,000
and we're gonna go through all of these different options.
64
00:02:39,000 --> 00:02:42,000
Don't really need to do anything with size and style,
65
00:02:42,000 --> 00:02:44,000
don't need a visual level title.
66
00:02:44,000 --> 00:02:45,000
We're gonna go into shape.
67
00:02:45,000 --> 00:02:47,000
One thing I do like to do for a lot
68
00:02:47,000 --> 00:02:50,000
of my cards is use the rounded rectangle
69
00:02:50,000 --> 00:02:54,000
and I like to do something like a 10% rounded corner.
70
00:02:54,000 --> 00:02:55,000
I think that looks pretty nice.
71
00:02:55,000 --> 00:02:59,000
And if we go to layout, we can change things like alignment
72
00:02:59,000 --> 00:03:00,000
and we can add a little bit of buffer
73
00:03:00,000 --> 00:03:02,000
or space between the cards.
74
00:03:02,000 --> 00:03:05,000
In this case, let's go ahead with a 20 pixel buffer.
75
00:03:05,000 --> 00:03:07,000
Next up, we can drill into our callout values
76
00:03:07,000 --> 00:03:10,000
and actually change the formatting of these numbers.
77
00:03:10,000 --> 00:03:13,000
And with most of these formatting menus,
78
00:03:13,000 --> 00:03:16,000
you'll have the option to apply universal changes to all
79
00:03:16,000 --> 00:03:19,000
of the series, or you can make specific changes
80
00:03:19,000 --> 00:03:20,000
to individual series.
81
00:03:20,000 --> 00:03:22,000
So there are a few updates that I wanna make
82
00:03:22,000 --> 00:03:25,000
to everything like the font.
83
00:03:25,000 --> 00:03:30,000
Let's go Segoe UI, do size 40 in bold
84
00:03:30,000 --> 00:03:32,000
and we're gonna use my favorite blue.
85
00:03:32,000 --> 00:03:35,000
And yes, I have memorized the hex code.
86
00:03:35,000 --> 00:03:38,000
It's 20E2D7 like so.
87
00:03:38,000 --> 00:03:42,000
And by default, let's show one decimal place.
88
00:03:42,000 --> 00:03:43,000
So that looks pretty good.
89
00:03:43,000 --> 00:03:46,000
Suppose I wanted a second decimal place
90
00:03:46,000 --> 00:03:48,000
for a metric like return rate.
91
00:03:48,000 --> 00:03:50,000
In that case, I would scroll up,
92
00:03:50,000 --> 00:03:53,000
select that specific series, and then go back down
93
00:03:53,000 --> 00:03:56,000
and add the second decimal just to that field.
94
00:03:56,000 --> 00:03:59,000
We can also edit the labels as well.
95
00:03:59,000 --> 00:04:02,000
So let's go ahead back to all series,
96
00:04:02,000 --> 00:04:05,000
drill into our label formatting options.
97
00:04:05,000 --> 00:04:08,000
Let's go Segoe UI, maybe 11 points.
98
00:04:08,000 --> 00:04:10,000
And I'm gonna make these white
99
00:04:10,000 --> 00:04:12,000
'cause I'm gonna do a dark gray fill
100
00:04:12,000 --> 00:04:14,000
in the background of these cards.
101
00:04:14,000 --> 00:04:16,000
You can change the position as well.
102
00:04:16,000 --> 00:04:19,000
You can do text wrap, all sorts of stuff there.
103
00:04:19,000 --> 00:04:20,000
But that's all I need to do as far
104
00:04:20,000 --> 00:04:23,000
as callout value formatting is concerned.
105
00:04:23,000 --> 00:04:25,000
Now we're gonna skip over reference labels.
106
00:04:25,000 --> 00:04:26,000
We're gonna talk about that in a bit.
107
00:04:26,000 --> 00:04:28,000
We'll add images in just a bit as well.
108
00:04:28,000 --> 00:04:31,000
But the card option, this is where I can apply some kind
109
00:04:31,000 --> 00:04:34,000
of general styling to each of these four cards.
110
00:04:34,000 --> 00:04:37,000
So you can do custom padding or default.
111
00:04:37,000 --> 00:04:39,000
You can add or modify the background.
112
00:04:39,000 --> 00:04:42,000
In this case, I like a nice dark gray background.
113
00:04:42,000 --> 00:04:45,000
And then you've got some other features here.
114
00:04:45,000 --> 00:04:47,000
Don't really need a border if we've got the background fill.
115
00:04:47,000 --> 00:04:50,000
You can do crazy things with shadows or glows.
116
00:04:50,000 --> 00:04:53,000
Don't really need to deal with that right now.
117
00:04:53,000 --> 00:04:55,000
But I do like the accent bar here.
118
00:04:55,000 --> 00:04:57,000
So you can do the accent bar on the left,
119
00:04:57,000 --> 00:04:59,000
top, bottom, or right.
120
00:04:59,000 --> 00:05:00,000
Let's give it that bright blue color.
121
00:05:00,000 --> 00:05:03,000
In this case, you can see it pop in the left.
122
00:05:03,000 --> 00:05:05,000
I'm just gonna add a little bit of width here, maybe four
123
00:05:05,000 --> 00:05:08,000
or five pixels, something kind of subtle like so.
124
00:05:08,000 --> 00:05:11,000
Now, last thing I wanna do is add some small images
125
00:05:11,000 --> 00:05:16,000
or icons so I can head into images, which is a new feature
126
00:05:16,000 --> 00:05:19,000
of these new cards and I can apply some universal settings
127
00:05:19,000 --> 00:05:21,000
to how I wanna handle these images.
128
00:05:21,000 --> 00:05:23,000
Let's go ahead and activate it.
129
00:05:23,000 --> 00:05:25,000
And by default, let's put these to the left
130
00:05:25,000 --> 00:05:27,000
of our label text here.
131
00:05:27,000 --> 00:05:29,000
We'll put six pixels of space,
132
00:05:29,000 --> 00:05:33,000
and I want my images to be pretty small, about 30 pixels.
133
00:05:33,000 --> 00:05:34,000
This is probably one of those things
134
00:05:34,000 --> 00:05:36,000
that's gonna take some trial and error
135
00:05:36,000 --> 00:05:38,000
depending on the image sizes that you're using.
136
00:05:38,000 --> 00:05:41,000
But I know that 30 works pretty well for mine.
137
00:05:41,000 --> 00:05:43,000
So once we've got those universal settings,
138
00:05:43,000 --> 00:05:46,000
I can drill into each individual setting
139
00:05:46,000 --> 00:05:48,000
and I can browse for an image file.
140
00:05:48,000 --> 00:05:52,000
So here's a revenue icon in white
141
00:05:52,000 --> 00:05:54,000
with a transparent background.
142
00:05:54,000 --> 00:05:55,000
That looks pretty good.
143
00:05:55,000 --> 00:05:58,000
Go into profit, browse for that icon,
144
00:06:00,000 --> 00:06:01,000
head into orders.
145
00:06:02,000 --> 00:06:04,000
There we go.
146
00:06:04,000 --> 00:06:06,000
And finally, return rates.
147
00:06:08,000 --> 00:06:09,000
So there you have it.
148
00:06:09,000 --> 00:06:13,000
So much simpler to be working with one single visual
149
00:06:13,000 --> 00:06:16,000
that captures all four of these metrics.
150
00:06:16,000 --> 00:06:18,000
So that's level one stuff.
151
00:06:18,000 --> 00:06:21,000
Now let's take it up a notch to level two
152
00:06:21,000 --> 00:06:22,000
and start seeing
153
00:06:22,000 --> 00:06:26,000
how these brand new reference labels actually work.
154
00:06:26,000 --> 00:06:27,000
So to do that, I'm gonna copy
155
00:06:27,000 --> 00:06:30,000
and paste that card visual we just created.
156
00:06:30,000 --> 00:06:33,000
And instead of going through the same process for all four
157
00:06:33,000 --> 00:06:36,000
of these metrics, I'm gonna simplify things for the demo
158
00:06:36,000 --> 00:06:38,000
and just focus on one for now.
159
00:06:38,000 --> 00:06:39,000
So just revenue
160
00:06:39,000 --> 00:06:42,000
and let's resize things a little bit like so.
161
00:06:42,000 --> 00:06:43,000
And basically, what I wanna do here
162
00:06:43,000 --> 00:06:46,000
is recreate something like we had here
163
00:06:46,000 --> 00:06:49,000
in our executive dashboard with our revenue order
164
00:06:49,000 --> 00:06:52,000
and return KPI cards, which remember,
165
00:06:52,000 --> 00:06:55,000
instead of showing the kind of top line aggregate totals,
166
00:06:55,000 --> 00:06:57,000
in this case, we're looking at the current month
167
00:06:57,000 --> 00:07:00,000
and comparing it against the previous month
168
00:07:00,000 --> 00:07:01,000
with a percent change.
169
00:07:01,000 --> 00:07:03,000
So let's jump back in.
170
00:07:03,000 --> 00:07:06,000
First thing I'm gonna do is change the filter context here
171
00:07:06,000 --> 00:07:09,000
so that we're only looking at the current month of data.
172
00:07:09,000 --> 00:07:12,000
Let's go ahead and drill into our filter pane.
173
00:07:12,000 --> 00:07:15,000
And we're gonna need that start of month field.
174
00:07:15,000 --> 00:07:20,000
I'm gonna add a visual level filter with a top N,
175
00:07:20,000 --> 00:07:24,000
we're gonna show the top one month
176
00:07:24,000 --> 00:07:26,000
based on the latest month.
177
00:07:26,000 --> 00:07:29,000
That's gonna give me a total revenue of 1.8.
178
00:07:29,000 --> 00:07:32,000
If we go back into formatting, callout values,
179
00:07:32,000 --> 00:07:35,000
we can add a second decimal place.
180
00:07:35,000 --> 00:07:37,000
Now, when you're dealing with reference labels,
181
00:07:37,000 --> 00:07:40,000
the rounded rectangle style doesn't really work so well.
182
00:07:40,000 --> 00:07:45,000
So let's go back into our options here, go into shape,
183
00:07:45,000 --> 00:07:48,000
and I'm gonna change this back to a standard rectangle.
184
00:07:48,000 --> 00:07:51,000
And now let's talk about what these reference labels
185
00:07:51,000 --> 00:07:53,000
are all about.
186
00:07:53,000 --> 00:07:56,000
First things first, I'm gonna add some universal formats
187
00:07:56,000 --> 00:07:59,000
and we're gonna turn on things like a divider line.
188
00:07:59,000 --> 00:08:03,000
That's gonna create a visual separation between my KPI value
189
00:08:03,000 --> 00:08:05,000
and the reference labels beneath it.
190
00:08:05,000 --> 00:08:10,000
Let's make that a bright blue with a width of two
191
00:08:10,000 --> 00:08:14,000
and the background fill where our reference labels will be,
192
00:08:14,000 --> 00:08:17,000
I want that to be just kind of a standard white,
193
00:08:17,000 --> 00:08:18,000
and it's kind of tough.
194
00:08:18,000 --> 00:08:19,000
I can't see what's changing
195
00:08:19,000 --> 00:08:22,000
because I don't have any reference labels yet.
196
00:08:22,000 --> 00:08:25,000
But as soon as I add one, you'll see what those formats
197
00:08:25,000 --> 00:08:27,000
that it just applied actually look like.
198
00:08:27,000 --> 00:08:30,000
So let's select a series, total revenue,
199
00:08:30,000 --> 00:08:32,000
and let's add a label.
200
00:08:32,000 --> 00:08:36,000
So what measure can we pull in that we want to display here
201
00:08:36,000 --> 00:08:38,000
that would give us some helpful context
202
00:08:38,000 --> 00:08:40,000
around this month's revenue?
203
00:08:40,000 --> 00:08:42,000
Well, maybe the previous month's revenue.
204
00:08:42,000 --> 00:08:46,000
Let's go ahead and select that and boom, it's dropped it in.
205
00:08:46,000 --> 00:08:47,000
Now what I love about this
206
00:08:47,000 --> 00:08:51,000
is that we can format every single component of this.
207
00:08:51,000 --> 00:08:54,000
So we can select that label, previous month revenue,
208
00:08:54,000 --> 00:08:57,000
we can customize the title.
209
00:08:57,000 --> 00:09:00,000
Let's make it a little bit simpler, last month.
210
00:09:00,000 --> 00:09:03,000
And we can also format just the value component
211
00:09:03,000 --> 00:09:06,000
of that label as well in here.
212
00:09:06,000 --> 00:09:08,000
Can make it bold, for instance.
213
00:09:08,000 --> 00:09:10,000
And instead of choosing auto display units,
214
00:09:10,000 --> 00:09:14,000
which rolled it up to the 2M that we see here,
215
00:09:14,000 --> 00:09:17,000
can choose none and show the actual entire value.
216
00:09:17,000 --> 00:09:21,000
Now, we can go ahead and add additional fields here as well.
217
00:09:21,000 --> 00:09:23,000
So we can add a second label.
218
00:09:23,000 --> 00:09:26,000
This time, maybe we want something like the revenue target
219
00:09:26,000 --> 00:09:29,000
that adds another line right beneath our old label.
220
00:09:29,000 --> 00:09:32,000
And again, we could do some formatting here.
221
00:09:32,000 --> 00:09:36,000
For the new label revenue target, let's do custom
222
00:09:36,000 --> 00:09:38,000
just call it Target.
223
00:09:39,000 --> 00:09:43,000
And for the value, same story here, we can make it bold
224
00:09:43,000 --> 00:09:45,000
and no display units.
225
00:09:45,000 --> 00:09:49,000
So now we can see that our current month revenue is 1.83.
226
00:09:49,000 --> 00:09:52,000
Last month, we were about 1.77.
227
00:09:52,000 --> 00:09:55,000
Our target was 1.945.
228
00:09:55,000 --> 00:09:57,000
We can add one more layer
229
00:09:57,000 --> 00:10:01,000
of detail here using the detail option that we can assign
230
00:10:01,000 --> 00:10:03,000
to any individual label.
231
00:10:03,000 --> 00:10:06,000
So right now, we're looking at the revenue target label
232
00:10:06,000 --> 00:10:10,000
and what kind of additional detail could we provide
233
00:10:10,000 --> 00:10:11,000
around that target?
234
00:10:11,000 --> 00:10:14,000
If you remember, we had a measure
235
00:10:14,000 --> 00:10:17,000
that was called Revenue Target Gap.
236
00:10:17,000 --> 00:10:18,000
Essentially, the difference
237
00:10:18,000 --> 00:10:21,000
between current month revenue and the target.
238
00:10:21,000 --> 00:10:24,000
So if we select that as our detail,
239
00:10:24,000 --> 00:10:28,000
now we can see that our target was 1.945 million
240
00:10:28,000 --> 00:10:33,000
and we fell short by about 118,000, but we're not done.
241
00:10:33,000 --> 00:10:36,000
One thing that I love is that there are so many places
242
00:10:36,000 --> 00:10:38,000
you can apply conditional formatting.
243
00:10:38,000 --> 00:10:41,000
Any time you see that FX icon,
244
00:10:41,000 --> 00:10:43,000
it means that you can get a little bit more fancy
245
00:10:43,000 --> 00:10:46,000
and conditionally format things like fonts or fills
246
00:10:46,000 --> 00:10:49,000
or background colors, even accent bars.
247
00:10:49,000 --> 00:10:52,000
So in this case, let's add some conditional formatting
248
00:10:52,000 --> 00:10:56,000
to the color of the font for that detail here.
249
00:10:56,000 --> 00:10:59,000
And what we're gonna do is a rule-based format
250
00:10:59,000 --> 00:11:01,000
and basically say, hey,
251
00:11:01,000 --> 00:11:05,000
if that revenue target gap is negative, right?
252
00:11:05,000 --> 00:11:07,000
If it's greater than or equal to the minimum value
253
00:11:07,000 --> 00:11:09,000
and less than zero, right?
254
00:11:09,000 --> 00:11:13,000
If it's a negative value, let's show that with a red font.
255
00:11:13,000 --> 00:11:17,000
Otherwise, if it's greater than or equal to zero
256
00:11:17,000 --> 00:11:21,000
and less than or equal to the maximum value, then you know,
257
00:11:21,000 --> 00:11:22,000
maybe we choose a green here
258
00:11:22,000 --> 00:11:25,000
or maybe we just show it with a dark gray.
259
00:11:25,000 --> 00:11:26,000
Press OK.
260
00:11:26,000 --> 00:11:28,000
And now check it out.
261
00:11:28,000 --> 00:11:30,000
That gap figure changed to red
262
00:11:30,000 --> 00:11:34,000
because our current month revenue fell short of the target.
263
00:11:34,000 --> 00:11:36,000
Pretty amazing stuff that we're able
264
00:11:36,000 --> 00:11:39,000
to produce in really just the matter of a few minutes.
265
00:11:39,000 --> 00:11:41,000
But if you wanna get even fancier,
266
00:11:41,000 --> 00:11:43,000
if you wanna get even more advanced,
267
00:11:43,000 --> 00:11:44,000
the first thing I wanna show you
268
00:11:44,000 --> 00:11:46,000
is how we can take these detail labels
269
00:11:48,000 --> 00:11:51,000
and add things like icons or graphics using DAX measures
270
00:11:51,000 --> 00:11:53,000
and UNICHAR functions.
271
00:11:53,000 --> 00:11:56,000
So check this out, I'm gonna head to my data view.
272
00:11:56,000 --> 00:12:00,000
And remember, we've got that revenue target gap measure.
273
00:12:00,000 --> 00:12:02,000
I'm gonna add a new measure here,
274
00:12:03,000 --> 00:12:07,000
and I'm gonna call this revenue target gap with arrow,
275
00:12:08,000 --> 00:12:11,000
and I'm gonna paste some code here
276
00:12:11,000 --> 00:12:12,000
and then explain it so that you don't have
277
00:12:12,000 --> 00:12:15,000
to see me type it all out bit by bit.
278
00:12:15,000 --> 00:12:17,000
So what we see here is initially,
279
00:12:17,000 --> 00:12:19,000
we're creating three variables,
280
00:12:19,000 --> 00:12:23,000
an uparrow, a downarrow, and revenuegap.
281
00:12:23,000 --> 00:12:24,000
Now uparrow and downarrow
282
00:12:24,000 --> 00:12:27,000
are both defined using the UNICHAR function,
283
00:12:27,000 --> 00:12:30,000
which pulls in a UNICHAR code like the ones
284
00:12:30,000 --> 00:12:34,000
that you see here, and essentially embeds an icon
285
00:12:34,000 --> 00:12:37,000
and treats it like a character that you can concatenate
286
00:12:37,000 --> 00:12:40,000
with other measures or other text strings.
287
00:12:40,000 --> 00:12:43,000
Now, you can look up UNICHAR tables to figure out
288
00:12:43,000 --> 00:12:47,000
how to find these codes for different symbols or icons,
289
00:12:47,000 --> 00:12:49,000
but I'm using code for an uparrow that I like,
290
00:12:49,000 --> 00:12:51,000
which is 129129,
291
00:12:51,000 --> 00:12:54,000
and a basic downarrow, which is 129131.
292
00:12:54,000 --> 00:12:56,000
And our revenuegap variable
293
00:12:56,000 --> 00:12:59,000
is just our revenue target gap measure.
294
00:12:59,000 --> 00:13:01,000
Now, in the return component of our measure,
295
00:13:01,000 --> 00:13:03,000
we can add some conditional logic
296
00:13:03,000 --> 00:13:06,000
and basically just say if that revenuegap is negative,
297
00:13:06,000 --> 00:13:08,000
if we fell short of our target,
298
00:13:08,000 --> 00:13:11,000
then I want to return the revenuegap value
299
00:13:11,000 --> 00:13:13,000
with a space and the downarrow.
300
00:13:13,000 --> 00:13:16,000
Otherwise show me the revenuegap with an uparrow.
301
00:13:16,000 --> 00:13:19,000
Because we're concatenating text and characters here,
302
00:13:19,000 --> 00:13:22,000
this measure will be formatted as a string.
303
00:13:22,000 --> 00:13:26,000
So to preserve the currency format that I want,
304
00:13:26,000 --> 00:13:28,000
what I'm doing is rounding the result of that measure
305
00:13:28,000 --> 00:13:31,000
to zero places, and then I'm wrapping that
306
00:13:31,000 --> 00:13:35,000
in a format function to display it as a currency format.
307
00:13:35,000 --> 00:13:38,000
So let's go ahead and save that new measure.
308
00:13:38,000 --> 00:13:42,000
And now all we need to do is go back to our visual,
309
00:13:42,000 --> 00:13:45,000
head to the formatting pane, go back to reference labels,
310
00:13:45,000 --> 00:13:48,000
all the way down to detail.
311
00:13:48,000 --> 00:13:50,000
And now instead of revenue target gap,
312
00:13:50,000 --> 00:13:54,000
we're gonna use revenue target gap with arrows
313
00:13:54,000 --> 00:13:55,000
and check it out.
314
00:13:55,000 --> 00:13:58,000
We get that same value, 118,000
315
00:13:58,000 --> 00:14:00,000
with that UNICHAR down arrow as well.
316
00:14:00,000 --> 00:14:03,000
Now you might be saying, all right, Chris, that's cool,
317
00:14:03,000 --> 00:14:06,000
but what about those awesome sparklines that we could add
318
00:14:06,000 --> 00:14:07,000
with the native KPI cards?
319
00:14:07,000 --> 00:14:10,000
How could we do something like that?
320
00:14:10,000 --> 00:14:12,000
Well, you can do that with SVGs.
321
00:14:12,000 --> 00:14:15,000
Those are scalable vector graphics.
322
00:14:15,000 --> 00:14:15,000
And there are a few things
323
00:14:15,000 --> 00:14:18,000
that are really awesome about SVGs.
324
00:14:18,000 --> 00:14:22,000
Number one, you can resize them to any size
325
00:14:22,000 --> 00:14:24,000
or dimensions without losing quality.
326
00:14:24,000 --> 00:14:27,000
They're supported by virtually every single browser.
327
00:14:27,000 --> 00:14:30,000
And the best part, you can use XML code
328
00:14:30,000 --> 00:14:34,000
to define different elements of an SVG, like the color,
329
00:14:34,000 --> 00:14:37,000
shape, size, position, and more.
330
00:14:37,000 --> 00:14:40,000
So our goal here is to use a custom SVG
331
00:14:40,000 --> 00:14:45,000
to embed a sparkline similar to those existing KPI cards,
332
00:14:45,000 --> 00:14:46,000
but much, much cooler.
333
00:14:46,000 --> 00:14:49,000
So let's go ahead and start by copying
334
00:14:49,000 --> 00:14:51,000
and pasting this existing visual.
335
00:14:51,000 --> 00:14:52,000
And similar story here.
336
00:14:52,000 --> 00:14:55,000
I'm just gonna demo with the revenue field.
337
00:14:55,000 --> 00:14:58,000
I don't need to do this four separate times.
338
00:14:58,000 --> 00:15:00,000
And drag it over here like so.
339
00:15:00,000 --> 00:15:03,000
Now, if you're really skilled with XML
340
00:15:03,000 --> 00:15:04,000
and you're familiar with SVGs,
341
00:15:04,000 --> 00:15:07,000
you can write this code from scratch.
342
00:15:07,000 --> 00:15:08,000
I'm not.
343
00:15:08,000 --> 00:15:10,000
So what I do is find great templates online
344
00:15:10,000 --> 00:15:13,000
and then modify them to suit my needs.
345
00:15:13,000 --> 00:15:15,000
So here's one amazing site
346
00:15:15,000 --> 00:15:17,000
where you can find some really cool templates.
347
00:15:17,000 --> 00:15:20,000
It's called kerrykolosko.com.
348
00:15:20,000 --> 00:15:22,000
And if you head to this website,
349
00:15:22,000 --> 00:15:23,000
you can drill into templates
350
00:15:23,000 --> 00:15:25,000
and you'll find SVG templates here.
351
00:15:25,000 --> 00:15:27,000
And the one that I'm gonna use
352
00:15:27,000 --> 00:15:30,000
is the gradient area sparkline with last point.
353
00:15:30,000 --> 00:15:32,000
So what we can do here is scroll down
354
00:15:32,000 --> 00:15:34,000
and you'll see all of this code
355
00:15:34,000 --> 00:15:37,000
which defines that SVG visual.
356
00:15:37,000 --> 00:15:39,000
You can click the clipboard to copy it
357
00:15:39,000 --> 00:15:41,000
and let's head back to Power BI
358
00:15:41,000 --> 00:15:43,000
and add this to a brand new measure.
359
00:15:43,000 --> 00:15:47,000
So let's go to data, add a new measure,
360
00:15:47,000 --> 00:15:50,000
and I'm just gonna go ahead and paste all that code in.
361
00:15:50,000 --> 00:15:52,000
You can see it looks really scary.
362
00:15:52,000 --> 00:15:53,000
We've got a bunch of errors,
363
00:15:53,000 --> 00:15:56,000
but don't worry, with a little bit of deductive reasoning,
364
00:15:56,000 --> 00:15:59,000
we can modify this to do exactly what we need.
365
00:15:59,000 --> 00:16:02,000
So let's go ahead and change the measure title
366
00:16:02,000 --> 00:16:05,000
to something like Revenue Sparkline.
367
00:16:05,000 --> 00:16:07,000
Now, there're a couple updates that I need to make.
368
00:16:07,000 --> 00:16:09,000
If you scroll through, you'll see a few places
369
00:16:09,000 --> 00:16:13,000
where date fields are referenced from a financials table.
370
00:16:13,000 --> 00:16:15,000
Obviously, we don't have a financials table in our model.
371
00:16:15,000 --> 00:16:17,000
This is just a placeholder.
372
00:16:17,000 --> 00:16:20,000
And we see a measure here called Sum of Gross Sales
373
00:16:20,000 --> 00:16:21,000
that we'll need to swap in
374
00:16:21,000 --> 00:16:24,000
for our total revenue measure as well.
375
00:16:24,000 --> 00:16:25,000
So let's do our dates first.
376
00:16:25,000 --> 00:16:28,000
And instead of financials[Date], I want this sparkline
377
00:16:28,000 --> 00:16:30,000
to be at the monthly level.
378
00:16:30,000 --> 00:16:32,000
So I'm gonna go to our calendar lookup
379
00:16:32,000 --> 00:16:34,000
and find the start of month field.
380
00:16:34,000 --> 00:16:37,000
And now I'm just gonna copy and paste that,
381
00:16:37,000 --> 00:16:40,000
replace every instance that I can find
382
00:16:40,000 --> 00:16:42,000
of financials[Date].
383
00:16:46,000 --> 00:16:49,000
And you can see I've got a financials table reference here,
384
00:16:49,000 --> 00:16:52,000
which will need to be updated with calendar lookup.
385
00:16:52,000 --> 00:16:55,000
And now let's do the same thing with this measure.
386
00:16:55,000 --> 00:16:59,000
Gonna change from sum gross sales to total revenue.
387
00:17:00,000 --> 00:17:03,000
And there are a few instances where I'll need to copy
388
00:17:03,000 --> 00:17:05,000
and paste that measure.
389
00:17:07,000 --> 00:17:09,000
So I think I've gotten all
390
00:17:09,000 --> 00:17:11,000
of the instances accounted for here.
391
00:17:11,000 --> 00:17:15,000
And just to be clear, I really have no idea what a lot
392
00:17:15,000 --> 00:17:16,000
of this code is doing,
393
00:17:16,000 --> 00:17:20,000
especially this XML custom format stuff here at the end.
394
00:17:20,000 --> 00:17:23,000
But it's pretty clear what fields we need to swap in
395
00:17:23,000 --> 00:17:25,000
to customize this to suit our needs.
396
00:17:25,000 --> 00:17:27,000
So let's go ahead and press enter here.
397
00:17:27,000 --> 00:17:29,000
That's gonna save our measure.
398
00:17:29,000 --> 00:17:32,000
And now let's go back to our visual, open up formatting,
399
00:17:32,000 --> 00:17:36,000
head to images, and let's go to total revenue.
400
00:17:36,000 --> 00:17:38,000
Get rid of that JPEG that we added.
401
00:17:38,000 --> 00:17:41,000
And now instead of image, we're gonna use image URL
402
00:17:41,000 --> 00:17:43,000
and click that function icon.
403
00:17:43,000 --> 00:17:46,000
We're gonna use the field value format style
404
00:17:46,000 --> 00:17:50,000
and base it on that measure we just created.
405
00:17:50,000 --> 00:17:51,000
So let's press OK.
406
00:17:51,000 --> 00:17:54,000
You can see a tiny 30 pixel image got added here
407
00:17:54,000 --> 00:17:56,000
to the left of our label.
408
00:17:56,000 --> 00:17:57,000
That's a good start, but obviously,
409
00:17:57,000 --> 00:18:00,000
we need to do a little bit of format tweaking here.
410
00:18:00,000 --> 00:18:05,000
So let's change our universal settings to bump this up
411
00:18:05,000 --> 00:18:06,000
to like 200.
412
00:18:06,000 --> 00:18:10,000
And instead of left of text, let's put it below the text,
413
00:18:10,000 --> 00:18:13,000
do a little resizing, and that's looking pretty good.
414
00:18:13,000 --> 00:18:16,000
The only thing I don't like is this kind of weird blue
415
00:18:16,000 --> 00:18:18,000
and the fade to gray.
416
00:18:18,000 --> 00:18:20,000
So let's go back to measures.
417
00:18:20,000 --> 00:18:23,000
We'll search for that sparkline measure.
418
00:18:23,000 --> 00:18:26,000
Now what I'm gonna do is look for these hex codes
419
00:18:26,000 --> 00:18:29,000
and I'm gonna replace them with the 20E2D7,
420
00:18:29,000 --> 00:18:32,000
and I'm gonna use a hex code for dark gray
421
00:18:32,000 --> 00:18:36,000
to match the background, which is 333333.
422
00:18:36,000 --> 00:18:38,000
So I'm gonna go through
423
00:18:38,000 --> 00:18:40,000
and make those updates here, 20E2D7,
424
00:18:43,000 --> 00:18:46,000
and instead of white, I'm gonna use another hex code.
425
00:18:46,000 --> 00:18:50,000
Looks like I need to include the %23 for compatibility.
426
00:18:50,000 --> 00:18:53,000
Then 333333.
427
00:18:53,000 --> 00:18:57,000
For these stop-colors, I want that blue, E2D7.
428
00:18:58,000 --> 00:19:02,000
And this will generally be a trial and error exercise.
429
00:19:02,000 --> 00:19:04,000
You might make a few changes, save the measure,
430
00:19:04,000 --> 00:19:06,000
see how it impacts the visual,
431
00:19:06,000 --> 00:19:08,000
then go back and make some more.
432
00:19:08,000 --> 00:19:10,000
That's kind of what I did here to realize
433
00:19:10,000 --> 00:19:12,000
that these were the exact places
434
00:19:12,000 --> 00:19:14,000
that I would need to make these changes.
435
00:19:14,000 --> 00:19:17,000
So I think those hex code updates look good.
436
00:19:17,000 --> 00:19:18,000
Last thing I wanna do
437
00:19:18,000 --> 00:19:21,000
is just drop the stroke width down a little bit
438
00:19:21,000 --> 00:19:24,000
from three to two for the line
439
00:19:24,000 --> 00:19:26,000
and also for that last point.
440
00:19:26,000 --> 00:19:30,000
And let's just scroll up, make sure things look good.
441
00:19:30,000 --> 00:19:31,000
It looks like we need a hash
442
00:19:31,000 --> 00:19:34,000
on that stop-color hex code right there.
443
00:19:34,000 --> 00:19:37,000
And let's go ahead and press enter
444
00:19:37,000 --> 00:19:39,000
and see how that impacted our visual.
445
00:19:39,000 --> 00:19:41,000
So boom, check it out.
446
00:19:41,000 --> 00:19:44,000
There is our beautifully formatted sparkline.
447
00:19:44,000 --> 00:19:46,000
So there you have it.
448
00:19:46,000 --> 00:19:51,000
That's our crash course in Power BI's brand new card visual.
449
00:19:51,000 --> 00:19:52,000
Hope you found it helpful.
450
00:19:52,000 --> 00:19:53,000
Hope you learned a thing or two,
451
00:19:53,000 --> 00:19:55,000
and I will see you in the next one.
35851
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.