All language subtitles for 006 Visual Calculations (February 2024)_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French Download
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
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:02,000 Instructor: In February, 2024, 2 00:00:02,000 --> 00:00:04,000 the Power BI team introduced some brand new features 3 00:00:04,000 --> 00:00:06,000 that aim to make DAX simpler 4 00:00:06,000 --> 00:00:09,000 and more approachable for the average user. 5 00:00:09,000 --> 00:00:12,000 Most notably something called visual calculations. 6 00:00:12,000 --> 00:00:13,000 In this video I'll introduce 7 00:00:13,000 --> 00:00:16,000 what visual calcs are all about, walk through some demos 8 00:00:16,000 --> 00:00:20,000 and summarize the major pros and cons to be aware of. 9 00:00:20,000 --> 00:00:22,000 Now, a couple important notes to keep in mind. 10 00:00:22,000 --> 00:00:25,000 Number one, this is a high level introduction, 11 00:00:25,000 --> 00:00:26,000 so we'll cover the basics here, 12 00:00:26,000 --> 00:00:28,000 but save some of the more custom 13 00:00:28,000 --> 00:00:31,000 or complex functionality for a future video. 14 00:00:31,000 --> 00:00:35,000 And two, these are brand new as of February, 2024, 15 00:00:35,000 --> 00:00:36,000 and still in preview mode. 16 00:00:36,000 --> 00:00:40,000 So keep in mind that things are changing very, very quickly. 17 00:00:40,000 --> 00:00:41,000 So with that, let's talk about 18 00:00:41,000 --> 00:00:44,000 what visual calculations are all about. 19 00:00:44,000 --> 00:00:47,000 Visual calcs are basically DAX calculations 20 00:00:47,000 --> 00:00:51,000 that are tied to a specific visual on the report canvas. 21 00:00:51,000 --> 00:00:53,000 They aren't added to your model 22 00:00:53,000 --> 00:00:55,000 like traditional calculated columns or measures, 23 00:00:55,000 --> 00:00:57,000 which means that they only exist 24 00:00:57,000 --> 00:00:59,000 within the scope of that visual 25 00:00:59,000 --> 00:01:02,000 and can't be used or referenced anywhere else. 26 00:01:02,000 --> 00:01:04,000 So take a look at this matrix here, 27 00:01:04,000 --> 00:01:07,000 where we're showing total orders by month and by year, 28 00:01:07,000 --> 00:01:09,000 and we've got some additional calculated fields 29 00:01:09,000 --> 00:01:12,000 like a running sum, moving average 30 00:01:12,000 --> 00:01:15,000 and some comparisons between time periods. 31 00:01:15,000 --> 00:01:17,000 Now you might notice that these feel really similar 32 00:01:17,000 --> 00:01:20,000 to things like table calcs in Tableau 33 00:01:20,000 --> 00:01:23,000 or pivot table value calculations in Excel. 34 00:01:23,000 --> 00:01:25,000 But these are examples of Power BIs, 35 00:01:25,000 --> 00:01:27,000 new visual calculations, 36 00:01:27,000 --> 00:01:31,000 which are indicated by the icons that you see here. 37 00:01:31,000 --> 00:01:34,000 And by editing one of these calculations, 38 00:01:34,000 --> 00:01:36,000 you'll see that we have a whole new environment 39 00:01:36,000 --> 00:01:37,000 inside of Power BI 40 00:01:37,000 --> 00:01:41,000 where we can create and modify these visual calcs. 41 00:01:41,000 --> 00:01:43,000 We've got a visual preview at the top, 42 00:01:43,000 --> 00:01:45,000 and a calculation pane at the bottom, 43 00:01:45,000 --> 00:01:48,000 which shows the DAX formula itself here in the formula bar 44 00:01:48,000 --> 00:01:51,000 along with the underlying data matrix 45 00:01:51,000 --> 00:01:54,000 that Power BI is using to produce the visual above. 46 00:01:54,000 --> 00:01:56,000 Now in this case, it looks almost identical 47 00:01:56,000 --> 00:01:59,000 since we're working with a matrix visual, 48 00:01:59,000 --> 00:02:00,000 but this can be really handy 49 00:02:00,000 --> 00:02:02,000 when using other types of charts and graphs 50 00:02:02,000 --> 00:02:05,000 where the underlying data structure isn't quite this clear. 51 00:02:05,000 --> 00:02:08,000 So let's talk about the major benefits 52 00:02:08,000 --> 00:02:09,000 of visual calculations. 53 00:02:09,000 --> 00:02:12,000 Number one, because they're stored on the visual, 54 00:02:12,000 --> 00:02:14,000 they don't bloat the data model 55 00:02:14,000 --> 00:02:16,000 with extra columns or measures. 56 00:02:16,000 --> 00:02:17,000 This is perfect for cases 57 00:02:17,000 --> 00:02:21,000 where you only need to show a calculated field in one place 58 00:02:21,000 --> 00:02:23,000 or at one level of granularity. 59 00:02:23,000 --> 00:02:26,000 They sealed significant performance benefits as well 60 00:02:26,000 --> 00:02:29,000 because they can operate on aggregated data 61 00:02:29,000 --> 00:02:31,000 compared to traditional calculated columns 62 00:02:31,000 --> 00:02:35,000 which are defined and stored at row level granularity. 63 00:02:35,000 --> 00:02:38,000 Number two, they're calculated using visual context. 64 00:02:38,000 --> 00:02:41,000 In other words, the data that you see right in front of you, 65 00:02:41,000 --> 00:02:45,000 which combines the simplicity of calculated columns 66 00:02:45,000 --> 00:02:49,000 with the on-demand calculation flexibility of measures. 67 00:02:49,000 --> 00:02:52,000 And this creates a more intuitive almost spreadsheet like 68 00:02:52,000 --> 00:02:53,000 calculation experience. 69 00:02:53,000 --> 00:02:56,000 And third, with the introduction of visual calculations 70 00:02:56,000 --> 00:03:00,000 comes a brand new suite of templates and functions 71 00:03:00,000 --> 00:03:03,000 that make writing and managing DAX much simpler. 72 00:03:03,000 --> 00:03:04,000 And this is especially true 73 00:03:04,000 --> 00:03:07,000 with things like ranks or running totals, 74 00:03:07,000 --> 00:03:09,000 which can be really tricky if you're new to Power BI, 75 00:03:09,000 --> 00:03:12,000 or if you're working with larger complex models. 76 00:03:12,000 --> 00:03:15,000 So for example, if I click this FX icon 77 00:03:15,000 --> 00:03:17,000 to the left of the formula bar, 78 00:03:17,000 --> 00:03:19,000 you'll see we've got these prebuilt templates 79 00:03:19,000 --> 00:03:21,000 for things like running sum, moving average, 80 00:03:21,000 --> 00:03:24,000 percent of parent, different types of averages 81 00:03:24,000 --> 00:03:26,000 or positional references. 82 00:03:26,000 --> 00:03:29,000 And in this case, we're able to define a running total 83 00:03:29,000 --> 00:03:32,000 using a single function and measure reference. 84 00:03:32,000 --> 00:03:35,000 Running sum, total orders, 85 00:03:35,000 --> 00:03:38,000 which is so much easier than writing a traditional measure 86 00:03:38,000 --> 00:03:42,000 to do the same thing, which would look something like this. 87 00:03:42,000 --> 00:03:44,000 So now that we have that context, 88 00:03:44,000 --> 00:03:46,000 let's go back to our report view 89 00:03:46,000 --> 00:03:49,000 and practice creating some visual calcs from scratch. 90 00:03:49,000 --> 00:03:50,000 Now if you'd like to follow along, 91 00:03:50,000 --> 00:03:53,000 I've added a new tab here called visual calcs 92 00:03:53,000 --> 00:03:56,000 with three different visuals on the canvas. 93 00:03:56,000 --> 00:03:59,000 We've got a matrix showing year and start of month 94 00:03:59,000 --> 00:04:02,000 with our total orders measure on values. 95 00:04:02,000 --> 00:04:04,000 We've got a second matrix, 96 00:04:04,000 --> 00:04:06,000 which is showing the category name, subcategory name 97 00:04:06,000 --> 00:04:10,000 and product with total revenue cost and profit measures. 98 00:04:10,000 --> 00:04:13,000 And finally, we've got a bar chart here, 99 00:04:13,000 --> 00:04:17,000 which is showing data broken down by occupation 100 00:04:17,000 --> 00:04:20,000 with total customers here on the X axis. 101 00:04:20,000 --> 00:04:23,000 And we'll start with our total orders matrix here, 102 00:04:23,000 --> 00:04:24,000 because time intelligence 103 00:04:24,000 --> 00:04:28,000 is one area where these visual calculations really shine. 104 00:04:28,000 --> 00:04:29,000 So check this out. 105 00:04:29,000 --> 00:04:31,000 If I select this visual, 106 00:04:31,000 --> 00:04:34,000 we now see an option here in the home tab 107 00:04:34,000 --> 00:04:36,000 where we can select new calculation. 108 00:04:36,000 --> 00:04:40,000 And this is what we'll use to define our visual calcs. 109 00:04:40,000 --> 00:04:41,000 So let's go ahead and give it a click. 110 00:04:41,000 --> 00:04:45,000 That's gonna open up our new visual calculation environment. 111 00:04:45,000 --> 00:04:48,000 And what I wanna do here is really just walk through 112 00:04:48,000 --> 00:04:49,000 some of these prebuilt templates 113 00:04:49,000 --> 00:04:52,000 to give you a sense of how these things work. 114 00:04:52,000 --> 00:04:53,000 Let's start with a running sum. 115 00:04:53,000 --> 00:04:55,000 You can see it drops in a formula 116 00:04:55,000 --> 00:04:59,000 right here in the formula bar with a brand new function 117 00:04:59,000 --> 00:05:01,000 that they're calling RUNNINGSUM. 118 00:05:01,000 --> 00:05:03,000 This is an example of syntax sugar 119 00:05:03,000 --> 00:05:05,000 or it's basically a shortcut 120 00:05:05,000 --> 00:05:07,000 that hides a lot of complicated stuff 121 00:05:07,000 --> 00:05:08,000 working behind the scenes 122 00:05:08,000 --> 00:05:11,000 with window functions like index and offset. 123 00:05:11,000 --> 00:05:14,000 Power BI is trying to make this as intuitive 124 00:05:14,000 --> 00:05:17,000 and seamless for users as possible. 125 00:05:17,000 --> 00:05:19,000 So it rolls up into this very simple function 126 00:05:19,000 --> 00:05:23,000 with just a single argument, which is the field name. 127 00:05:23,000 --> 00:05:25,000 This is where I can input any columns, or fields 128 00:05:25,000 --> 00:05:28,000 or measures, or other visual calcs 129 00:05:28,000 --> 00:05:29,000 that are part of this visual. 130 00:05:29,000 --> 00:05:31,000 In this case, I can choose start of month, 131 00:05:31,000 --> 00:05:33,000 total orders or year. 132 00:05:33,000 --> 00:05:35,000 In this case, I want the running sum 133 00:05:35,000 --> 00:05:37,000 or the running total of orders, 134 00:05:37,000 --> 00:05:39,000 so I'll select that measure and press enter. 135 00:05:39,000 --> 00:05:42,000 And there you go. Now we have a running sum, 136 00:05:42,000 --> 00:05:44,000 which basically just adds up the total orders 137 00:05:44,000 --> 00:05:47,000 and aggregates them into the total 138 00:05:47,000 --> 00:05:52,000 all the way down to the grand total of 13,325. 139 00:05:52,000 --> 00:05:54,000 Very, very simple, very straightforward stuff. 140 00:05:54,000 --> 00:05:56,000 Let's try a moving average here. 141 00:05:56,000 --> 00:05:59,000 Again, got another custom function introduced 142 00:05:59,000 --> 00:06:01,000 with visual calcs called moving average. 143 00:06:01,000 --> 00:06:03,000 This time we've got two arguments. 144 00:06:03,000 --> 00:06:06,000 Again, we're gonna start with the field reference. 145 00:06:06,000 --> 00:06:07,000 Again, total orders. 146 00:06:07,000 --> 00:06:09,000 Now window size, this is basically 147 00:06:09,000 --> 00:06:13,000 how many items we want to include in our average. 148 00:06:13,000 --> 00:06:18,000 So we could start with something like two and press enter. 149 00:06:18,000 --> 00:06:20,000 And what that's gonna do is basically just average 150 00:06:20,000 --> 00:06:24,000 the previous two items at any view in our visual. 151 00:06:24,000 --> 00:06:29,000 So for instance, 174.5 is the average of 184 and 165, 152 00:06:30,000 --> 00:06:32,000 and so on and so forth. 153 00:06:32,000 --> 00:06:34,000 This works at different layers of granularity. 154 00:06:34,000 --> 00:06:36,000 So as you roll up or down, 155 00:06:36,000 --> 00:06:39,000 those calculations still calculate properly 156 00:06:39,000 --> 00:06:43,000 no matter what level of granularity you're looking at here. 157 00:06:43,000 --> 00:06:44,000 So that one's pretty straightforward. 158 00:06:44,000 --> 00:06:48,000 What if we wanted to change the window from two to three? 159 00:06:48,000 --> 00:06:51,000 Well, we could head to our build to visual pane here, 160 00:06:51,000 --> 00:06:54,000 click this right arrow, edit the calculation 161 00:06:54,000 --> 00:06:57,000 and just swap the two for three. 162 00:06:57,000 --> 00:07:00,000 Press enter, and we'll see our calculation change. 163 00:07:00,000 --> 00:07:02,000 Next up, let's take a quick look at some of these 164 00:07:02,000 --> 00:07:06,000 comparisons here versus previous, next, first and last. 165 00:07:06,000 --> 00:07:09,000 We'll circle back to the percent of parent and children. 166 00:07:09,000 --> 00:07:12,000 But for now, let's try something like versus previous, 167 00:07:12,000 --> 00:07:15,000 this kind of positional reference here. 168 00:07:15,000 --> 00:07:17,000 Again, very simple formula, just two arguments. 169 00:07:17,000 --> 00:07:19,000 They both reference a field name 170 00:07:19,000 --> 00:07:23,000 and as always, we're gonna reference total orders. 171 00:07:23,000 --> 00:07:25,000 And all we're doing here, 172 00:07:25,000 --> 00:07:30,000 is comparing the total order value against the previous one. 173 00:07:30,000 --> 00:07:32,000 And like we talked about, this is really simple 174 00:07:32,000 --> 00:07:34,000 when you're dealing with tools like Excel 175 00:07:34,000 --> 00:07:36,000 but can be much trickier 176 00:07:36,000 --> 00:07:38,000 to accomplish using traditional DAX, 177 00:07:38,000 --> 00:07:40,000 this makes it much, much easier. 178 00:07:40,000 --> 00:07:45,000 So total orders of 165 in February, 2020, 179 00:07:45,000 --> 00:07:48,000 that's 19 fewer orders than the previous month. 180 00:07:48,000 --> 00:07:52,000 198 is 33 more than 165. 181 00:07:52,000 --> 00:07:55,000 That's what the versus previous calculation is doing. 182 00:07:55,000 --> 00:07:59,000 And then very, very similar case for versus next. 183 00:07:59,000 --> 00:08:03,000 And let's just show it just to be complete here, 184 00:08:04,000 --> 00:08:07,000 total orders instead of referencing the last value, 185 00:08:07,000 --> 00:08:10,000 this is just gonna reference the next value. 186 00:08:10,000 --> 00:08:13,000 Again, this works even as you roll up or down, 187 00:08:13,000 --> 00:08:15,000 or drill in or out of your matrix 188 00:08:15,000 --> 00:08:17,000 it's still gonna calculate properly, which is great. 189 00:08:17,000 --> 00:08:22,000 And then last thing we'll see is the versus first and last. 190 00:08:22,000 --> 00:08:24,000 So same two arguments as always, 191 00:08:24,000 --> 00:08:26,000 this should be familiar by now. 192 00:08:26,000 --> 00:08:28,000 Total orders, total orders. 193 00:08:28,000 --> 00:08:32,000 This one's gonna reference against the first visible value 194 00:08:32,000 --> 00:08:33,000 in the visual in this case, 195 00:08:33,000 --> 00:08:37,000 184 is the first value at this layer in the matrix. 196 00:08:37,000 --> 00:08:42,000 So every other value is referenced against that 184. 197 00:08:42,000 --> 00:08:43,000 And then of course versus last 198 00:08:43,000 --> 00:08:45,000 is gonna do the exact same thing, 199 00:08:45,000 --> 00:08:48,000 but instead of referencing the first value, 200 00:08:48,000 --> 00:08:52,000 it's gonna reference the last visible value in the visual. 201 00:08:53,000 --> 00:08:55,000 Let's go ahead and enter that in. 202 00:08:55,000 --> 00:08:58,000 So now we're just comparing against 2056. 203 00:08:58,000 --> 00:09:00,000 That's our baseline for all of these 204 00:09:00,000 --> 00:09:02,000 versus last calculations here. 205 00:09:02,000 --> 00:09:04,000 Now what's great about this is that 206 00:09:04,000 --> 00:09:06,000 you might create visual calculations 207 00:09:06,000 --> 00:09:10,000 as helper columns that contribute to other calculations, 208 00:09:10,000 --> 00:09:11,000 you might replace measures 209 00:09:11,000 --> 00:09:13,000 that you no longer need to show in the visual, 210 00:09:13,000 --> 00:09:16,000 what you can do is update these show hide options 211 00:09:16,000 --> 00:09:20,000 to determine exactly what's visible inside of your visual. 212 00:09:20,000 --> 00:09:22,000 So for instance, maybe we don't need all of those 213 00:09:22,000 --> 00:09:24,000 calculations we just created. 214 00:09:24,000 --> 00:09:27,000 Maybe we only want the running sum, the average, 215 00:09:27,000 --> 00:09:28,000 and versus previous. 216 00:09:28,000 --> 00:09:30,000 We can keep these calculations here 217 00:09:30,000 --> 00:09:33,000 but temporarily hide them from the visual itself. 218 00:09:33,000 --> 00:09:35,000 So with that, let's jump back to our report. 219 00:09:35,000 --> 00:09:37,000 You can see that our visual will update 220 00:09:37,000 --> 00:09:40,000 with those new fields that we added, which looks good. 221 00:09:40,000 --> 00:09:41,000 And now next up, 222 00:09:41,000 --> 00:09:44,000 I wanna take a look at some of these other templates 223 00:09:44,000 --> 00:09:47,000 for percent of parent, average of children, 224 00:09:47,000 --> 00:09:48,000 things like that. 225 00:09:48,000 --> 00:09:48,000 And to do that, 226 00:09:48,000 --> 00:09:51,000 we're gonna take a look at our product matrix here. 227 00:09:51,000 --> 00:09:54,000 And again, we'll go to home, new calculation 228 00:09:54,000 --> 00:09:57,000 to get into our visual calc environment. 229 00:09:57,000 --> 00:09:58,000 And it's worth noting that 230 00:09:58,000 --> 00:10:01,000 we don't have to use the templates. 231 00:10:01,000 --> 00:10:03,000 This is really just a collection of shortcuts 232 00:10:03,000 --> 00:10:06,000 to make these calculations easy for everyday users. 233 00:10:06,000 --> 00:10:09,000 But you can write your own custom DAX in here, 234 00:10:09,000 --> 00:10:12,000 which is great if you need something a bit more complex 235 00:10:12,000 --> 00:10:13,000 or a bit more custom. 236 00:10:13,000 --> 00:10:16,000 In this case, suppose we wanted to calculate 237 00:10:16,000 --> 00:10:18,000 a visual calculation version of profit, 238 00:10:18,000 --> 00:10:21,000 which is revenue minus cost. 239 00:10:21,000 --> 00:10:23,000 You can see we have the measure version of profit 240 00:10:23,000 --> 00:10:25,000 already visible in our visual. 241 00:10:25,000 --> 00:10:29,000 Could give this one a name like profit, 242 00:10:29,000 --> 00:10:31,000 and just like any other calculated column, right, 243 00:10:31,000 --> 00:10:36,000 we can reference the fields here like total revenue 244 00:10:36,000 --> 00:10:40,000 minus total cost and press enter. 245 00:10:40,000 --> 00:10:43,000 And that's going to add our visual calculation for profit 246 00:10:43,000 --> 00:10:46,000 and you can see that our values match perfectly, 247 00:10:46,000 --> 00:10:47,000 which is great. 248 00:10:47,000 --> 00:10:49,000 And again, this can be really helpful for scenarios 249 00:10:49,000 --> 00:10:54,000 where maybe we only need to show profit in one single chart 250 00:10:54,000 --> 00:10:58,000 or we only care about profit at the product category level. 251 00:10:58,000 --> 00:11:00,000 In those cases, visual calculations 252 00:11:00,000 --> 00:11:03,000 could be much more performant and efficient 253 00:11:03,000 --> 00:11:07,000 than defining a profit calculated column or measure 254 00:11:07,000 --> 00:11:10,000 that evaluates at the row level granularity. 255 00:11:10,000 --> 00:11:13,000 And one thing you might have noticed is the formatting 256 00:11:13,000 --> 00:11:14,000 or lack thereof. 257 00:11:14,000 --> 00:11:17,000 So we were able to format our profit measure 258 00:11:17,000 --> 00:11:19,000 exactly as we wanted to. 259 00:11:19,000 --> 00:11:21,000 In this case with a currency format. 260 00:11:21,000 --> 00:11:24,000 We currently don't have the ability to do that 261 00:11:24,000 --> 00:11:25,000 with visual calculations. 262 00:11:25,000 --> 00:11:29,000 There's no formatting menu that we can access here. 263 00:11:29,000 --> 00:11:32,000 So what we have to do, at least for the time being, 264 00:11:32,000 --> 00:11:35,000 is force the format using a format function 265 00:11:35,000 --> 00:11:37,000 inside the formula bar. 266 00:11:37,000 --> 00:11:38,000 So lemme show you what that looks like. 267 00:11:38,000 --> 00:11:40,000 We can edit the calculation 268 00:11:40,000 --> 00:11:43,000 and all I'm gonna do is wrap that formula 269 00:11:44,000 --> 00:11:46,000 in a format function. 270 00:11:46,000 --> 00:11:50,000 And in this case we're gonna format it as currency, 271 00:11:50,000 --> 00:11:53,000 which will look something like this. 272 00:11:53,000 --> 00:11:55,000 And we're gonna round it down, we don't need decimal points. 273 00:11:55,000 --> 00:11:59,000 So we'll use a kind of format string like this. 274 00:11:59,000 --> 00:12:03,000 And now when we press enter, you can see those values update 275 00:12:03,000 --> 00:12:05,000 and now it's formatted just like we had formatted 276 00:12:05,000 --> 00:12:07,000 that measure version as well. 277 00:12:07,000 --> 00:12:10,000 So suppose this matrix is really all about 278 00:12:10,000 --> 00:12:12,000 profit calculations. 279 00:12:12,000 --> 00:12:15,000 That case maybe we could choose to hide 280 00:12:15,000 --> 00:12:16,000 some of these component fields. 281 00:12:16,000 --> 00:12:19,000 We can hide the original profit measure as well. 282 00:12:19,000 --> 00:12:22,000 And now we're left just with that profit visual calc 283 00:12:22,000 --> 00:12:23,000 that we defined. 284 00:12:23,000 --> 00:12:25,000 Next up, let's explore some of those other templates 285 00:12:25,000 --> 00:12:27,000 that we haven't looked at yet. 286 00:12:27,000 --> 00:12:29,000 Starting with percent of parent. 287 00:12:29,000 --> 00:12:31,000 And this one looks a little bit more complicated, right? 288 00:12:31,000 --> 00:12:33,000 We've got a couple different functions in here, 289 00:12:33,000 --> 00:12:37,000 divide and collapse, which is a brand new DAX function 290 00:12:37,000 --> 00:12:38,000 that you may not be familiar with, 291 00:12:38,000 --> 00:12:41,000 but there's still only three user inputs 292 00:12:41,000 --> 00:12:42,000 that we need to deal with. 293 00:12:42,000 --> 00:12:44,000 And two of them are just referencing 294 00:12:44,000 --> 00:12:46,000 the field that we care about. 295 00:12:46,000 --> 00:12:48,000 Which in this case is profit. 296 00:12:48,000 --> 00:12:50,000 So I'm actually gonna reference 297 00:12:50,000 --> 00:12:52,000 the measure version of profit, 298 00:12:52,000 --> 00:12:54,000 which I can even though it's not visible right now. 299 00:12:54,000 --> 00:12:57,000 And I'll show you why in just a second. 300 00:12:57,000 --> 00:13:00,000 So total profit, total profit. 301 00:13:00,000 --> 00:13:03,000 Now the axis, this will be either rows or columns 302 00:13:03,000 --> 00:13:06,000 depending on how our matrix is oriented. 303 00:13:06,000 --> 00:13:09,000 And this case we have our product and category 304 00:13:09,000 --> 00:13:11,000 and subcategory fields on rows. 305 00:13:11,000 --> 00:13:13,000 So we'll use a rose argument here. 306 00:13:13,000 --> 00:13:15,000 If we had transposed that 307 00:13:15,000 --> 00:13:17,000 and put our product names on columns, 308 00:13:17,000 --> 00:13:20,000 we could use columns as this argument instead. 309 00:13:20,000 --> 00:13:21,000 But that should do the trick 310 00:13:21,000 --> 00:13:23,000 if I go ahead and press enter, 311 00:13:23,000 --> 00:13:25,000 could see we've got these percent values. 312 00:13:25,000 --> 00:13:28,000 Again, not formatted by default, 313 00:13:28,000 --> 00:13:31,000 but this is basically telling us for any given category, 314 00:13:31,000 --> 00:13:33,000 what percentage does it represent 315 00:13:33,000 --> 00:13:35,000 out of its parent values, right? 316 00:13:35,000 --> 00:13:38,000 So if we look at subcategories first, 317 00:13:38,000 --> 00:13:42,000 jerseys represented 48% of the total clothing profit, 318 00:13:42,000 --> 00:13:44,000 which is its parent category. 319 00:13:44,000 --> 00:13:47,000 Gloves represented 39%, 320 00:13:47,000 --> 00:13:50,000 and caps represented the remaining 13%. 321 00:13:50,000 --> 00:13:53,000 And then within those subcategories, 322 00:13:53,000 --> 00:13:56,000 we can see the breakdown or composition of profit 323 00:13:56,000 --> 00:13:58,000 at the product level, right? 324 00:13:58,000 --> 00:14:00,000 So this short sleeve classic jersey 325 00:14:00,000 --> 00:14:03,000 and extra large accounted for 11% 326 00:14:03,000 --> 00:14:05,000 of the total jersey profit, 327 00:14:05,000 --> 00:14:08,000 that's to interpret 8% of parent calculation. 328 00:14:08,000 --> 00:14:11,000 And we could go ahead and format that one 329 00:14:11,000 --> 00:14:13,000 just like we did with our last calculation. 330 00:14:13,000 --> 00:14:17,000 We're gonna wrap it in a format function 331 00:14:17,000 --> 00:14:20,000 and this time we could use something kind of like this. 332 00:14:20,000 --> 00:14:24,000 We'll round it off, add a percentage sign, and there we go. 333 00:14:24,000 --> 00:14:26,000 That's a bit more readable. 334 00:14:26,000 --> 00:14:29,000 Now next up, let's look at the percent of grand total. 335 00:14:29,000 --> 00:14:30,000 This one's pretty intuitive, 336 00:14:30,000 --> 00:14:34,000 but again, uses some brand new functions like collapse all. 337 00:14:35,000 --> 00:14:37,000 Let's go ahead and reference the total profit 338 00:14:37,000 --> 00:14:39,000 measure again here. 339 00:14:39,000 --> 00:14:41,000 Total profit, total profit. 340 00:14:41,000 --> 00:14:45,000 Again, we're gonna deal with rows as our axis, 341 00:14:45,000 --> 00:14:48,000 and let's just get ahead of it and add our format. 342 00:14:48,000 --> 00:14:49,000 While we're thinking of it, 343 00:14:50,000 --> 00:14:54,000 we're gonna wrap all of that in a format function. 344 00:14:54,000 --> 00:14:57,000 And let's use that same percent format 345 00:14:57,000 --> 00:15:00,000 like we did before, like so. 346 00:15:00,000 --> 00:15:01,000 So now we have percent of grand total 347 00:15:01,000 --> 00:15:04,000 instead of percent of parent. 348 00:15:04,000 --> 00:15:07,000 And the difference is that now at every single level, 349 00:15:07,000 --> 00:15:09,000 whether it's subcategory or product, 350 00:15:09,000 --> 00:15:12,000 we're basing that percentage calculation 351 00:15:12,000 --> 00:15:14,000 against the grand total value. 352 00:15:14,000 --> 00:15:16,000 So now the difference is that 353 00:15:16,000 --> 00:15:18,000 that same short sleeve classic jersey 354 00:15:18,000 --> 00:15:22,000 that made up 11% of jersey profits, 355 00:15:22,000 --> 00:15:24,000 now we're seeing that it only makes up 5% 356 00:15:24,000 --> 00:15:26,000 of the overall profits. 357 00:15:26,000 --> 00:15:27,000 So similar calculation, 358 00:15:27,000 --> 00:15:29,000 just a slightly different perspective, 359 00:15:29,000 --> 00:15:33,000 different way of looking at profit performance. 360 00:15:33,000 --> 00:15:34,000 Alright, so last but not least, 361 00:15:34,000 --> 00:15:38,000 let's take a look at this last one, average of children. 362 00:15:38,000 --> 00:15:39,000 This is gonna use an expand 363 00:15:39,000 --> 00:15:42,000 and an average function here, just two arguments. 364 00:15:42,000 --> 00:15:46,000 You can see this is super easy, just field and access again 365 00:15:46,000 --> 00:15:49,000 and this time instead of the measure version of profit, 366 00:15:49,000 --> 00:15:53,000 I'm gonna point to the visual calculation version of profit. 367 00:15:53,000 --> 00:15:55,000 And again, I'll show you why in just a sec. 368 00:15:55,000 --> 00:15:57,000 Axis is gonna be rows. 369 00:15:57,000 --> 00:15:59,000 Let's go ahead and lock that in. 370 00:15:59,000 --> 00:16:00,000 And what happens? 371 00:16:00,000 --> 00:16:04,000 Well, we get an error. It says we can't display the visual. 372 00:16:04,000 --> 00:16:05,000 And if you read the error line here, 373 00:16:05,000 --> 00:16:08,000 it says the function average cannot work 374 00:16:08,000 --> 00:16:10,000 with values of type string. 375 00:16:10,000 --> 00:16:14,000 So let's go back and edit this calculation. 376 00:16:14,000 --> 00:16:15,000 You might be wondering, well, 377 00:16:15,000 --> 00:16:17,000 what the heck we're averaging profit, 378 00:16:17,000 --> 00:16:20,000 which is a numerical value field, right? 379 00:16:20,000 --> 00:16:22,000 Well, the catch is that when we included 380 00:16:22,000 --> 00:16:24,000 that format function, 381 00:16:24,000 --> 00:16:28,000 we actually turned our profit visual calc into a text string 382 00:16:28,000 --> 00:16:31,000 and text strings can't be averaged. 383 00:16:31,000 --> 00:16:33,000 So there are two things we could do to fix this. 384 00:16:33,000 --> 00:16:35,000 We could either remove the format statement 385 00:16:35,000 --> 00:16:37,000 from our profit calculation, 386 00:16:37,000 --> 00:16:40,000 or we could reference the total profit measure 387 00:16:40,000 --> 00:16:43,000 which is properly formatted as a value. 388 00:16:43,000 --> 00:16:46,000 So we kind of have to make a little bit of a trade off here. 389 00:16:46,000 --> 00:16:47,000 In this case, let's go ahead 390 00:16:47,000 --> 00:16:51,000 and reference the measure version and press enter. 391 00:16:51,000 --> 00:16:54,000 And when we do that, all is well 392 00:16:54,000 --> 00:16:58,000 and we get the proper averages here in our visual preview. 393 00:16:58,000 --> 00:17:01,000 And to interpret these averages of children, 394 00:17:01,000 --> 00:17:03,000 basically we're looking at the average 395 00:17:03,000 --> 00:17:05,000 of the next layer of granularity. 396 00:17:05,000 --> 00:17:07,000 So when we look at the clothing line, 397 00:17:07,000 --> 00:17:09,000 which is the highest level of granularity 398 00:17:09,000 --> 00:17:10,000 here in this visual, 399 00:17:10,000 --> 00:17:13,000 we are averaging each subcategory. 400 00:17:13,000 --> 00:17:16,000 So the profit for jerseys, gloves and caps 401 00:17:16,000 --> 00:17:19,000 averages out to 31,244. 402 00:17:19,000 --> 00:17:22,000 And then within those subcategories we're averaging out 403 00:17:22,000 --> 00:17:25,000 the product level profits that they contain. 404 00:17:25,000 --> 00:17:27,000 So let's head back to our report. 405 00:17:27,000 --> 00:17:30,000 Last thing I wanna show you is a non matrix example. 406 00:17:30,000 --> 00:17:32,000 Here we've got a bar chart 407 00:17:32,000 --> 00:17:36,000 that's showing our total customer count by occupation. 408 00:17:36,000 --> 00:17:39,000 And by default we're using our total customer measure, 409 00:17:39,000 --> 00:17:41,000 which is a count of customers. 410 00:17:41,000 --> 00:17:44,000 But suppose that instead of showing the counts here, 411 00:17:44,000 --> 00:17:47,000 we actually wanted to modify this visual a little bit 412 00:17:47,000 --> 00:17:51,000 and actually turn this into a percent of total visual. 413 00:17:51,000 --> 00:17:53,000 Now I could start defining a whole bunch 414 00:17:53,000 --> 00:17:56,000 of DAX functions using calculate all and divide, 415 00:17:56,000 --> 00:17:58,000 add a bunch of measures to our models. 416 00:17:58,000 --> 00:18:02,000 But this is actually a great use case for visual calcs. 417 00:18:02,000 --> 00:18:06,000 So let's jump into our calculation pane here, 418 00:18:06,000 --> 00:18:10,000 and let's add a calculation for percent of grand total. 419 00:18:10,000 --> 00:18:13,000 And the field that we're dividing is total customers 420 00:18:14,000 --> 00:18:17,000 and we're gonna collapse total customers. 421 00:18:18,000 --> 00:18:21,000 And we are dealing with data on rows here, 422 00:18:21,000 --> 00:18:23,000 which we can see in our visual matrix preview. 423 00:18:23,000 --> 00:18:25,000 Let's press enter. 424 00:18:25,000 --> 00:18:28,000 Now by default, it's going to show 425 00:18:28,000 --> 00:18:30,000 both of those fields in the same visual, 426 00:18:30,000 --> 00:18:31,000 which doesn't make sense 427 00:18:31,000 --> 00:18:33,000 they're on totally different scales. 428 00:18:33,000 --> 00:18:35,000 And just like before, we don't really need to show 429 00:18:35,000 --> 00:18:37,000 the volume metric anymore, 430 00:18:37,000 --> 00:18:40,000 we just wanna visualize this as percentages 431 00:18:40,000 --> 00:18:44,000 so we can hide that original measure from the visual. 432 00:18:44,000 --> 00:18:46,000 And let's jump back to our report now. 433 00:18:46,000 --> 00:18:50,000 And now we're looking at just those percent of totals. 434 00:18:50,000 --> 00:18:53,000 We could format those as percentages as well, 435 00:18:53,000 --> 00:18:54,000 but we could also do some cool things 436 00:18:54,000 --> 00:18:57,000 like we could sort based on those grand totals now. 437 00:18:57,000 --> 00:19:00,000 And if we wanted to do a little bit of formatting, 438 00:19:00,000 --> 00:19:02,000 maybe we add some data labels, 439 00:19:02,000 --> 00:19:05,000 and we put 'em inside of the ends of the bars. 440 00:19:05,000 --> 00:19:07,000 And now we've got a visual that shows 441 00:19:07,000 --> 00:19:12,000 the percent of total customers broken down by occupation 442 00:19:12,000 --> 00:19:15,000 and we didn't even have to add a single new measure 443 00:19:15,000 --> 00:19:16,000 to our model. 444 00:19:16,000 --> 00:19:18,000 So really nice common use case 445 00:19:18,000 --> 00:19:21,000 for when visual calculations can really come in handy. 446 00:19:21,000 --> 00:19:24,000 So now that we've seen visual calculations in action, 447 00:19:24,000 --> 00:19:27,000 let's recap some of the major pros and cons. 448 00:19:27,000 --> 00:19:28,000 Now on the pro side, 449 00:19:28,000 --> 00:19:32,000 this new concept of visual context is a game changer. 450 00:19:32,000 --> 00:19:34,000 It makes DAX simpler and more intuitive, 451 00:19:34,000 --> 00:19:38,000 especially for large models or complex calculations 452 00:19:38,000 --> 00:19:40,000 that require positional references. 453 00:19:40,000 --> 00:19:43,000 Things like ranks or running totals 454 00:19:43,000 --> 00:19:45,000 that traditionally are quite challenging to define 455 00:19:45,000 --> 00:19:48,000 using normal DAX measures. 456 00:19:48,000 --> 00:19:51,000 Visual calculations can also be quite a bit more performant 457 00:19:51,000 --> 00:19:53,000 than traditional calculated columns 458 00:19:53,000 --> 00:19:56,000 because they can be applied at aggregated levels 459 00:19:56,000 --> 00:19:59,000 or to specific individual visuals. 460 00:19:59,000 --> 00:20:01,000 And as a result, you can avoid model bloat. 461 00:20:01,000 --> 00:20:03,000 They reduce the need for 462 00:20:03,000 --> 00:20:06,000 extra unnecessary calculated columns and measures 463 00:20:06,000 --> 00:20:08,000 in the semantic model. 464 00:20:08,000 --> 00:20:09,000 And again, this is ideal 465 00:20:09,000 --> 00:20:11,000 when you just have a metric that you wanna show 466 00:20:11,000 --> 00:20:13,000 in one chart, in your report 467 00:20:13,000 --> 00:20:16,000 or at one specific level of granularity. 468 00:20:16,000 --> 00:20:18,000 One of the nice things about visual calcs 469 00:20:18,000 --> 00:20:21,000 is that they include all of those prebuilt templates 470 00:20:21,000 --> 00:20:23,000 and the supporting function set as well. 471 00:20:23,000 --> 00:20:26,000 Functions like EXPAND, COLLAPSE, RUNNINGSUM, 472 00:20:26,000 --> 00:20:28,000 FIRST, NEXT et cetera. 473 00:20:28,000 --> 00:20:31,000 This makes it so much easier to use these functions 474 00:20:31,000 --> 00:20:34,000 compared to the underlying window functions 475 00:20:34,000 --> 00:20:37,000 that are actually driving the calculations. 476 00:20:37,000 --> 00:20:39,000 And one thing that I find super helpful 477 00:20:39,000 --> 00:20:41,000 is the visual calculation editor 478 00:20:41,000 --> 00:20:44,000 and how it shows the exact data structure 479 00:20:44,000 --> 00:20:46,000 behind a specific visual on the canvas. 480 00:20:46,000 --> 00:20:47,000 This is really helpful, 481 00:20:47,000 --> 00:20:50,000 especially for brand new Power BI users. 482 00:20:50,000 --> 00:20:52,000 And then last but not least, 483 00:20:52,000 --> 00:20:54,000 love that visual calcs allow you to customize 484 00:20:54,000 --> 00:20:58,000 which calculations or fields are shown or hidden 485 00:20:58,000 --> 00:20:59,000 inside of a visual. 486 00:20:59,000 --> 00:21:02,000 That level of flexibility is a really nice touch. 487 00:21:02,000 --> 00:21:04,000 Now on the con side. 488 00:21:04,000 --> 00:21:07,000 For one, this does create a pretty fragmented DAX authoring 489 00:21:07,000 --> 00:21:09,000 and editing experience. 490 00:21:09,000 --> 00:21:11,000 There are now three or four different places 491 00:21:11,000 --> 00:21:14,000 where you can write DAX code inside of Power BI desktop. 492 00:21:14,000 --> 00:21:15,000 And the challenge is that the functionality 493 00:21:15,000 --> 00:21:18,000 is kind of inconsistent between them. 494 00:21:18,000 --> 00:21:20,000 So there are certain DAX measures and functions 495 00:21:20,000 --> 00:21:23,000 that might work in one place but not in another. 496 00:21:23,000 --> 00:21:26,000 And trying to find and edit those visual calculations 497 00:21:26,000 --> 00:21:28,000 can be a little bit tricky at first. 498 00:21:29,000 --> 00:21:31,000 Another con is that these calculations 499 00:21:31,000 --> 00:21:34,000 are isolated to specific visuals, 500 00:21:34,000 --> 00:21:37,000 and you can't use them or reference them elsewhere. 501 00:21:37,000 --> 00:21:38,000 In fact, at this point 502 00:21:38,000 --> 00:21:40,000 I don't even think you can copy and paste 503 00:21:40,000 --> 00:21:43,000 visual calculation code between different visuals. 504 00:21:43,000 --> 00:21:46,000 So you do end up having to create these visual calcs 505 00:21:46,000 --> 00:21:50,000 from scratch each time you need to produce them. 506 00:21:50,000 --> 00:21:51,000 Now because these are brand new, 507 00:21:51,000 --> 00:21:53,000 they're currently only compatible 508 00:21:53,000 --> 00:21:56,000 with a subset of basic native visuals. 509 00:21:56,000 --> 00:21:58,000 At this point, they don't work with maps, 510 00:21:58,000 --> 00:22:00,000 they don't work with combo charts, 511 00:22:00,000 --> 00:22:02,000 they don't work with custom visuals. 512 00:22:02,000 --> 00:22:03,000 And like we showed, 513 00:22:03,000 --> 00:22:05,000 there are pretty limited formatting, filtering 514 00:22:05,000 --> 00:22:07,000 and sorting options here. 515 00:22:07,000 --> 00:22:08,000 You can't use conditional formats, 516 00:22:08,000 --> 00:22:10,000 you can't use data categories, 517 00:22:10,000 --> 00:22:13,000 you can't even use standard formatting options. 518 00:22:13,000 --> 00:22:15,000 You need to use a format function 519 00:22:15,000 --> 00:22:18,000 to kind of force these visual calculations 520 00:22:18,000 --> 00:22:20,000 into the formats that you're looking for. 521 00:22:20,000 --> 00:22:23,000 I do expect this one to get better over time 522 00:22:23,000 --> 00:22:25,000 as we get closer to general availability. 523 00:22:25,000 --> 00:22:27,000 There's also quite limited functionality 524 00:22:27,000 --> 00:22:30,000 as far as Power BI service is concerned. 525 00:22:30,000 --> 00:22:33,000 So you can't edit visual calcs in service. 526 00:22:33,000 --> 00:22:35,000 You also can't publish reports to web 527 00:22:35,000 --> 00:22:37,000 that use visual calculations. 528 00:22:37,000 --> 00:22:38,000 And then last but not least, 529 00:22:38,000 --> 00:22:40,000 remember this is still a preview feature, 530 00:22:40,000 --> 00:22:43,000 so documentation is limited, 531 00:22:43,000 --> 00:22:46,000 and features really do continue to change pretty frequently. 532 00:22:46,000 --> 00:22:49,000 Now if you'd like to learn more about visual calcs, 533 00:22:49,000 --> 00:22:52,000 head to learn.microsoft.com, 534 00:22:52,000 --> 00:22:55,000 and here you'll find some really helpful resources, 535 00:22:55,000 --> 00:22:58,000 including this article here about visual calculations 536 00:22:58,000 --> 00:23:00,000 that talk about how to enable them. 537 00:23:00,000 --> 00:23:02,000 Talks about the editing pain, 538 00:23:02,000 --> 00:23:05,000 talks about how to hide fields, how to use the templates. 539 00:23:05,000 --> 00:23:07,000 These are the different access options that we talked about, 540 00:23:07,000 --> 00:23:09,000 rows and columns. 541 00:23:09,000 --> 00:23:12,000 And then one thing that's super helpful at the bottom, 542 00:23:12,000 --> 00:23:14,000 these are all of the new available functions 543 00:23:14,000 --> 00:23:16,000 and what they do, 544 00:23:16,000 --> 00:23:18,000 and then there's a whole kind of comprehensive list 545 00:23:18,000 --> 00:23:21,000 of current limitations as well. 546 00:23:21,000 --> 00:23:21,000 So there you have it. 547 00:23:21,000 --> 00:23:25,000 That's our overview of Power BIs new visual calculations, 548 00:23:25,000 --> 00:23:26,000 hope you found it helpful, 549 00:23:26,000 --> 00:23:27,000 and if you've taken some time 550 00:23:27,000 --> 00:23:29,000 to play with these on your own, 551 00:23:29,000 --> 00:23:30,000 go ahead and draw me a comment 552 00:23:30,000 --> 00:23:32,000 and let me know what you think. 44258

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.