All language subtitles for 002 Calculation Groups (October 2023)_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 this video, we're going to cover 2 00:00:02,000 --> 00:00:04,000 one of the exciting new features of the Model view 3 00:00:04,000 --> 00:00:08,000 in Power BI, calculation groups. 4 00:00:08,000 --> 00:00:11,000 Now, calculation groups in Power BI provide a way 5 00:00:11,000 --> 00:00:14,000 to simplify measure management by grouping 6 00:00:14,000 --> 00:00:18,000 common calculations into a single table structure, 7 00:00:18,000 --> 00:00:20,000 which reduces the total number of measures 8 00:00:20,000 --> 00:00:22,000 that are needed within your data model. 9 00:00:22,000 --> 00:00:25,000 Now commonly, calculation groups are used 10 00:00:25,000 --> 00:00:27,000 with time intelligence calculations, 11 00:00:27,000 --> 00:00:30,000 currency conversion, scenario analysis, 12 00:00:30,000 --> 00:00:32,000 and dynamic measures. 13 00:00:32,000 --> 00:00:35,000 We're going to focus on time intelligence in this video. 14 00:00:35,000 --> 00:00:37,000 But if you're interested in exploring 15 00:00:37,000 --> 00:00:40,000 additional use cases and scenarios, 16 00:00:40,000 --> 00:00:42,000 it's definitely worth checking out some 17 00:00:42,000 --> 00:00:44,000 of these other common scenarios. 18 00:00:44,000 --> 00:00:47,000 So setting up calculation groups is pretty straightforward. 19 00:00:47,000 --> 00:00:51,000 And they can actually be created in desktop or service. 20 00:00:51,000 --> 00:00:54,000 So from a high level, there are two main components. 21 00:00:54,000 --> 00:00:59,000 We've got calculation groups and calculation items. 22 00:00:59,000 --> 00:01:03,000 Now first up, you have calculation groups, 23 00:01:03,000 --> 00:01:06,000 which is really just a collection of calculation items. 24 00:01:06,000 --> 00:01:08,000 So instead of creating multiple measures 25 00:01:08,000 --> 00:01:11,000 for calculations, like year-to-date, 26 00:01:11,000 --> 00:01:13,000 quarter-to-date, month-to-date, year-over-year, 27 00:01:13,000 --> 00:01:16,000 same period last year, et cetera, 28 00:01:16,000 --> 00:01:18,000 so instead of having to create all 29 00:01:18,000 --> 00:01:20,000 of the time intelligence versions 30 00:01:20,000 --> 00:01:22,000 for each of those measures, 31 00:01:22,000 --> 00:01:25,000 you can create a single calculation group, 32 00:01:25,000 --> 00:01:29,000 and then define the items that belong to each group. 33 00:01:30,000 --> 00:01:33,000 The other component are calculation items, 34 00:01:33,000 --> 00:01:35,000 which are used to define the specific 35 00:01:35,000 --> 00:01:38,000 calculations within a calculation group. 36 00:01:38,000 --> 00:01:41,000 So each calculation item represents 37 00:01:41,000 --> 00:01:45,000 a specific calculation or variation of a calculation, 38 00:01:45,000 --> 00:01:48,000 and then are applied to the explicit measure 39 00:01:48,000 --> 00:01:50,000 to alter that measures calculation. 40 00:01:50,000 --> 00:01:53,000 We'll dig into exactly what this means in the demo. 41 00:01:53,000 --> 00:01:56,000 But one of the really important pieces to note here 42 00:01:56,000 --> 00:01:58,000 is that when you first enable 43 00:01:58,000 --> 00:02:00,000 or first create a calculation group, 44 00:02:00,000 --> 00:02:02,000 you'll get this notification 45 00:02:02,000 --> 00:02:05,000 that implicit measures are discouraged. 46 00:02:05,000 --> 00:02:09,000 And the reason is that calculation groups and items 47 00:02:09,000 --> 00:02:13,000 only work with measures that are explicitly defined. 48 00:02:13,000 --> 00:02:15,000 So this is really a great opportunity 49 00:02:15,000 --> 00:02:18,000 to reinforce Power BI best practices 50 00:02:18,000 --> 00:02:22,000 and create explicit measures against the data model. 51 00:02:22,000 --> 00:02:25,000 So once we have our calculation groups defined 52 00:02:25,000 --> 00:02:27,000 and the calculation items added, 53 00:02:27,000 --> 00:02:29,000 we can now use these calculation groups 54 00:02:29,000 --> 00:02:32,000 in our visuals where it makes sense. 55 00:02:32,000 --> 00:02:35,000 So let's take a look at an example of a matrix visual 56 00:02:35,000 --> 00:02:40,000 that is built out with uniquely created specific measures. 57 00:02:40,000 --> 00:02:42,000 So as you can see here, 58 00:02:42,000 --> 00:02:45,000 we have a base measure for total revenue. 59 00:02:45,000 --> 00:02:48,000 And we've also built out five additional explicit 60 00:02:48,000 --> 00:02:52,000 time intelligence measures, all based on revenue. 61 00:02:52,000 --> 00:02:53,000 Now, I'm not saying that there's 62 00:02:53,000 --> 00:02:54,000 anything wrong with this approach. 63 00:02:54,000 --> 00:02:58,000 But as you continue to add more base measures, 64 00:02:58,000 --> 00:03:00,000 like total profit, total orders, 65 00:03:00,000 --> 00:03:03,000 we've got total revenue here, so on and so forth, 66 00:03:03,000 --> 00:03:05,000 you're required to create new, 67 00:03:05,000 --> 00:03:10,000 unique time intelligence functions for each base measure. 68 00:03:10,000 --> 00:03:11,000 So needless to stay, 69 00:03:11,000 --> 00:03:14,000 this really starts to clutter the Measures view. 70 00:03:14,000 --> 00:03:18,000 And it can create a lot of individual measures. 71 00:03:18,000 --> 00:03:19,000 In our second view here, 72 00:03:19,000 --> 00:03:23,000 we've removed all of those individual unique measures 73 00:03:23,000 --> 00:03:27,000 and have added in our time intelligence calculation group. 74 00:03:27,000 --> 00:03:29,000 So what this allows us to do is to add 75 00:03:29,000 --> 00:03:32,000 that same total revenue base measure. 76 00:03:32,000 --> 00:03:35,000 But instead of adding five unique measures, 77 00:03:35,000 --> 00:03:37,000 we're only adding in a single calculation group. 78 00:03:37,000 --> 00:03:40,000 And despite the header naming conventions 79 00:03:40,000 --> 00:03:44,000 being slightly different, the values are identical. 80 00:03:44,000 --> 00:03:46,000 What's really exciting here is that we can 81 00:03:46,000 --> 00:03:48,000 actually add in a field parameter 82 00:03:48,000 --> 00:03:51,000 that contains a bunch of different measures, 83 00:03:51,000 --> 00:03:54,000 and then use that parameter to dynamically update 84 00:03:54,000 --> 00:03:57,000 the base value within the matrix, or the visual, 85 00:03:57,000 --> 00:03:59,000 within that calculation group. 86 00:03:59,000 --> 00:04:01,000 So it's seriously cool. 87 00:04:01,000 --> 00:04:03,000 And we'll actually end up doing this as part 88 00:04:03,000 --> 00:04:06,000 of our report page toward the end of this demo. 89 00:04:06,000 --> 00:04:08,000 All right, let's head over to Power BI. 90 00:04:08,000 --> 00:04:10,000 And we're gonna build out our calculation group. 91 00:04:10,000 --> 00:04:14,000 All right, so I've already built out a matrix visual here 92 00:04:14,000 --> 00:04:17,000 where we are looking at our category name. 93 00:04:17,000 --> 00:04:20,000 So we've got mountain bikes and road bikes. 94 00:04:20,000 --> 00:04:22,000 I've added in a date hierarchy 95 00:04:22,000 --> 00:04:24,000 from the calendar lookup table. 96 00:04:24,000 --> 00:04:27,000 So we have 2022 for January, February, 97 00:04:27,000 --> 00:04:29,000 March, April, May, right? 98 00:04:29,000 --> 00:04:31,000 So we're basically looking at 2022, 99 00:04:31,000 --> 00:04:33,000 the first six months of the year. 100 00:04:33,000 --> 00:04:37,000 And then, I have added in a bunch of different measures. 101 00:04:37,000 --> 00:04:40,000 So like I said, I've got my total revenue base measure. 102 00:04:40,000 --> 00:04:45,000 And then, I've also built out these five revenue-specific 103 00:04:45,000 --> 00:04:47,000 time intelligence measures, right? 104 00:04:47,000 --> 00:04:48,000 So previous month revenue, 105 00:04:48,000 --> 00:04:51,000 total revenue month-over-month percent change, 106 00:04:51,000 --> 00:04:52,000 total revenue month-over-month, 107 00:04:52,000 --> 00:04:54,000 quarter-to-date, and year-to-date. 108 00:04:54,000 --> 00:04:56,000 All right, so this is the formula that you would need 109 00:04:56,000 --> 00:05:00,000 to follow if you wanted to create the same version 110 00:05:00,000 --> 00:05:04,000 for things like profit, or sales, or order volume, 111 00:05:04,000 --> 00:05:06,000 or bulk orders, or whatever the case is. 112 00:05:08,000 --> 00:05:11,000 So what we want to do with our calculation group 113 00:05:11,000 --> 00:05:13,000 is clean all of this up. 114 00:05:13,000 --> 00:05:17,000 So in order to start building out calculation groups, 115 00:05:17,000 --> 00:05:18,000 the easiest way that I found 116 00:05:18,000 --> 00:05:21,000 is heading over to the Model view here. 117 00:05:21,000 --> 00:05:23,000 And you can see within the Data Model view 118 00:05:23,000 --> 00:05:24,000 we have tables. 119 00:05:24,000 --> 00:05:26,000 And in the Model view, 120 00:05:26,000 --> 00:05:30,000 we have this little calculation group option here. 121 00:05:30,000 --> 00:05:34,000 So from here, we could right-click on the More Options menu 122 00:05:34,000 --> 00:05:36,000 and define a new calculation group. 123 00:05:36,000 --> 00:05:39,000 That's one way we could tackle this. 124 00:05:39,000 --> 00:05:42,000 The other option is to come up here to our ribbon 125 00:05:42,000 --> 00:05:45,000 and create a new calculation group from the Ribbon menu. 126 00:05:45,000 --> 00:05:48,000 Either way, you're gonna end up in the exact same spot. 127 00:05:50,000 --> 00:05:54,000 All right, so couple of things to notice here, right? 128 00:05:54,000 --> 00:05:57,000 If we look at our calculation group, right, 129 00:05:57,000 --> 00:05:59,000 we see that we have a one next to here. 130 00:05:59,000 --> 00:06:01,000 So we've started to create a placeholder 131 00:06:01,000 --> 00:06:03,000 for our first calculation group. 132 00:06:03,000 --> 00:06:04,000 It's just named Calculation Group. 133 00:06:04,000 --> 00:06:07,000 So it's gonna be important to update the name here. 134 00:06:07,000 --> 00:06:09,000 And we've also started to create 135 00:06:09,000 --> 00:06:12,000 the structure for calculation items. 136 00:06:12,000 --> 00:06:15,000 And you can see here that we have our first 137 00:06:15,000 --> 00:06:18,000 calculation item that's been defined. 138 00:06:18,000 --> 00:06:22,000 And it uses this DAX function called Selected Measure. 139 00:06:22,000 --> 00:06:26,000 And what Selected Measure does is it's just an expression 140 00:06:26,000 --> 00:06:29,000 that is designed specifically for calculation items 141 00:06:29,000 --> 00:06:32,000 and dynamic format strings to reference the measure 142 00:06:32,000 --> 00:06:35,000 that is within the context. 143 00:06:35,000 --> 00:06:36,000 So by within the context, 144 00:06:36,000 --> 00:06:39,000 what they mean is that when you add 145 00:06:39,000 --> 00:06:43,000 a explicitly defined measure to a visual, 146 00:06:43,000 --> 00:06:46,000 that is the current measure within the context. 147 00:06:46,000 --> 00:06:50,000 So any calculation items that are built out are 148 00:06:50,000 --> 00:06:54,000 then going to be applied to that measure within the context. 149 00:06:54,000 --> 00:06:57,000 All right, so for our first calculation item, 150 00:06:57,000 --> 00:06:59,000 we're gonna update this. 151 00:06:59,000 --> 00:07:01,000 And I'm gonna call this Current Measure. 152 00:07:06,000 --> 00:07:07,000 Current Measure, all right? 153 00:07:07,000 --> 00:07:09,000 So this is always just going to be 154 00:07:09,000 --> 00:07:14,000 the version of the measure that is within the context. 155 00:07:14,000 --> 00:07:16,000 So we'll hit Enter to lock this in. 156 00:07:16,000 --> 00:07:18,000 And we'll see this calculation item name 157 00:07:18,000 --> 00:07:20,000 update to Current Measure. 158 00:07:21,000 --> 00:07:22,000 That looks great. 159 00:07:22,000 --> 00:07:26,000 Can actually see it here as well within the Properties pane. 160 00:07:26,000 --> 00:07:29,000 Now, if we come up to the calculation group 161 00:07:29,000 --> 00:07:30,000 and click on this, 162 00:07:30,000 --> 00:07:32,000 we can update the naming convention 163 00:07:32,000 --> 00:07:34,000 used for this calculation group. 164 00:07:34,000 --> 00:07:38,000 So let's call this something like Time Intelligence. 165 00:07:41,000 --> 00:07:44,000 Again, you can add in your description, synonyms, 166 00:07:44,000 --> 00:07:45,000 all sorts of stuff. 167 00:07:45,000 --> 00:07:50,000 So now, we have our Time Intelligence calculation group. 168 00:07:50,000 --> 00:07:53,000 And we've started to define our calculation items. 169 00:07:54,000 --> 00:07:57,000 So from here, we can click on Calculation Item. 170 00:07:57,000 --> 00:07:59,000 And again, you have this More Options menu 171 00:07:59,000 --> 00:08:01,000 where you can hide, collapse, expand, 172 00:08:01,000 --> 00:08:04,000 or add new calculation items. 173 00:08:04,000 --> 00:08:08,000 When you click on this header in the Property pane, 174 00:08:08,000 --> 00:08:09,000 this brings up an option to add 175 00:08:09,000 --> 00:08:12,000 a new calculation item here as well. 176 00:08:12,000 --> 00:08:14,000 So let's go through and start building 177 00:08:14,000 --> 00:08:17,000 out some of our other calculation items. 178 00:08:17,000 --> 00:08:18,000 All right, so up first, 179 00:08:18,000 --> 00:08:21,000 let's build out a calculation item 180 00:08:21,000 --> 00:08:23,000 to calculate previous month. 181 00:08:23,000 --> 00:08:26,000 So we'll call this Previous Month. 182 00:08:27,000 --> 00:08:30,000 And here, we're gonna use our Calculate statement. 183 00:08:30,000 --> 00:08:34,000 So we wanna calculate the value of the selected measure. 184 00:08:37,000 --> 00:08:40,000 We wanna do that in a modified filter context. 185 00:08:40,000 --> 00:08:44,000 We're gonna do Date Add in a modified filter context 186 00:08:44,000 --> 00:08:49,000 where we're gonna shift the calendar look up dates, 187 00:08:52,000 --> 00:08:53,000 right here, 188 00:08:56,000 --> 00:08:57,000 back one month. 189 00:08:59,000 --> 00:09:00,000 All right, that's our period. 190 00:09:02,000 --> 00:09:04,000 All right, so this is exactly how we would 191 00:09:04,000 --> 00:09:08,000 build out any other previous month measure. 192 00:09:08,000 --> 00:09:12,000 But instead of referencing a specific measure 193 00:09:12,000 --> 00:09:16,000 or formula here within the expression 194 00:09:16,000 --> 00:09:17,000 of the Calculate statement, 195 00:09:17,000 --> 00:09:19,000 all we're doing is we're referencing 196 00:09:19,000 --> 00:09:21,000 the selected measure value. 197 00:09:21,000 --> 00:09:23,000 Again, that's the important piece to understand 198 00:09:23,000 --> 00:09:26,000 here is that it's whatever that... 199 00:09:26,000 --> 00:09:29,000 The measure is in the context of the visual 200 00:09:29,000 --> 00:09:33,000 is going to be selected and applied for this calculation. 201 00:09:33,000 --> 00:09:34,000 All right, so we've got our current measures, 202 00:09:34,000 --> 00:09:37,000 our base, previous month. 203 00:09:37,000 --> 00:09:40,000 Let's add in a new calculation item 204 00:09:40,000 --> 00:09:43,000 for quarter-to-date and year-to-date. 205 00:09:43,000 --> 00:09:46,000 All right, so this is going to be quarter-to-date 206 00:09:47,000 --> 00:09:50,000 equals same start here with calculate, 207 00:09:51,000 --> 00:09:53,000 and then selected measure. 208 00:09:55,000 --> 00:09:58,000 And here, we'll use our dates, quarter-to-date function 209 00:10:00,000 --> 00:10:05,000 with the date column from our calendar lookup table. 210 00:10:10,000 --> 00:10:13,000 All right, and I'm going to copy this. 211 00:10:14,000 --> 00:10:17,000 And I'm copying this because I'm gonna 212 00:10:17,000 --> 00:10:19,000 update this for year-to-date. 213 00:10:19,000 --> 00:10:21,000 It's basically the same exact format, 214 00:10:21,000 --> 00:10:25,000 just instead of dates QTD, it dates YTD. 215 00:10:25,000 --> 00:10:27,000 So we'll make that update real quick, 216 00:10:27,000 --> 00:10:29,000 add new item. 217 00:10:31,000 --> 00:10:32,000 We'll paste. 218 00:10:34,000 --> 00:10:39,000 And then, update our name and our function, 219 00:10:39,000 --> 00:10:40,000 dates YTD. 220 00:10:41,000 --> 00:10:42,000 And then, we'll lock this in. 221 00:10:44,000 --> 00:10:44,000 All right, perfect. 222 00:10:44,000 --> 00:10:46,000 So there's two more calculation 223 00:10:46,000 --> 00:10:47,000 items that I want to add in, 224 00:10:47,000 --> 00:10:49,000 one for month-over-month, 225 00:10:49,000 --> 00:10:52,000 and then another from month-over-month percent change. 226 00:10:52,000 --> 00:10:56,000 So let's start off with our month-over-month value. 227 00:10:58,000 --> 00:11:01,000 And I'm gonna use some variables as part of this, 228 00:11:01,000 --> 00:11:03,000 just to kind of clean it up and make it readable. 229 00:11:03,000 --> 00:11:06,000 So we're gonna start off with our kind of current value. 230 00:11:08,000 --> 00:11:11,000 And this is just going to equal the selected measure. 231 00:11:14,000 --> 00:11:15,000 The next thing that we wanna do is 232 00:11:15,000 --> 00:11:17,000 we wanna to define the previous value. 233 00:11:22,000 --> 00:11:25,000 And here, we're basically gonna calculate 234 00:11:25,000 --> 00:11:29,000 our last month's version of the selected measure. 235 00:11:29,000 --> 00:11:32,000 So again, we'll start off with our calculate 236 00:11:32,000 --> 00:11:35,000 and then we're gonna use the selected measure, 237 00:11:35,000 --> 00:11:38,000 our date add function. 238 00:11:39,000 --> 00:11:41,000 And again, we're gonna take our calendar date, 239 00:11:45,000 --> 00:11:47,000 our calendar date field, 240 00:11:47,000 --> 00:11:49,000 and we're gonna shift our dates back one month. 241 00:11:51,000 --> 00:11:54,000 All right, and then here for our return, 242 00:11:54,000 --> 00:11:58,000 we basically just wanna subtract the current value 243 00:12:00,000 --> 00:12:01,000 from the previous value. 244 00:12:09,000 --> 00:12:11,000 Awesome, we'll lock this in. 245 00:12:11,000 --> 00:12:14,000 Sweet, and then, the last thing that we're gonna do 246 00:12:14,000 --> 00:12:18,000 is we'll create a item for month-over-month percent change. 247 00:12:20,000 --> 00:12:22,000 And this is gonna be month-over... 248 00:12:22,000 --> 00:12:25,000 Month-over-month percent 249 00:12:28,000 --> 00:12:29,000 change, 250 00:12:29,000 --> 00:12:31,000 and just using Alt + 30 on the keyboard 251 00:12:31,000 --> 00:12:34,000 to go through and define that delta symbol. 252 00:12:34,000 --> 00:12:36,000 But you can make that whatever you want. 253 00:12:36,000 --> 00:12:38,000 All right, so again, here we're gonna start off, 254 00:12:38,000 --> 00:12:41,000 we're gonna create a couple of variables 255 00:12:41,000 --> 00:12:42,000 for our current value. 256 00:12:43,000 --> 00:12:46,000 Again, this is going to equal the selected measure. 257 00:12:48,000 --> 00:12:50,000 We wanna define our previous value. 258 00:12:54,000 --> 00:12:59,000 Again, we're gonna calculate the selected value. 259 00:13:03,000 --> 00:13:05,000 Excuse me, selected measure, 260 00:13:09,000 --> 00:13:12,000 where our date add... 261 00:13:13,000 --> 00:13:16,000 All right, we wanna shift our dates 262 00:13:19,000 --> 00:13:20,000 back one month. 263 00:13:25,000 --> 00:13:26,000 Close that out. 264 00:13:28,000 --> 00:13:29,000 All right, and then, same thing. 265 00:13:29,000 --> 00:13:33,000 We wanna create our variable here 266 00:13:33,000 --> 00:13:35,000 for the difference of these two values. 267 00:13:35,000 --> 00:13:36,000 So basically, we're just redefining 268 00:13:36,000 --> 00:13:38,000 that month-over-month value. 269 00:13:38,000 --> 00:13:42,000 Again, we could have copied and pasted this and updated it. 270 00:13:42,000 --> 00:13:44,000 But it never hurts to work through the DAX. 271 00:13:44,000 --> 00:13:47,000 Current value minus previous value. 272 00:13:49,000 --> 00:13:50,000 And then, return. 273 00:13:51,000 --> 00:13:53,000 We'll use the divide function. 274 00:13:54,000 --> 00:13:57,000 And then, we're gonna divide our difference value 275 00:13:58,000 --> 00:14:02,000 from previous value to get the month-over-month change. 276 00:14:08,000 --> 00:14:09,000 Awesome. 277 00:14:09,000 --> 00:14:12,000 All right, so we've got everything defined. 278 00:14:12,000 --> 00:14:14,000 Let's head over to our Report view. 279 00:14:14,000 --> 00:14:17,000 And I wanna build out a new visual. 280 00:14:17,000 --> 00:14:21,000 So let's use our visual here as a base. 281 00:14:21,000 --> 00:14:26,000 And I'm gonna copy and paste this, just to duplicate it. 282 00:14:30,000 --> 00:14:32,000 And then, I'm just gonna shrink this top one 283 00:14:32,000 --> 00:14:35,000 to give us a little bit of space to work with here. 284 00:14:36,000 --> 00:14:38,000 All right, and I'll come in. 285 00:14:38,000 --> 00:14:43,000 And I actually wanna remove all of these values. 286 00:14:43,000 --> 00:14:47,000 So revenue on all of the time intelligence ones 287 00:14:47,000 --> 00:14:50,000 that we built out, right? 288 00:14:50,000 --> 00:14:53,000 So now, we're basically stuck, or left, 289 00:14:53,000 --> 00:14:55,000 with this blank canvas. 290 00:14:55,000 --> 00:14:59,000 So what I need to do here is add in my base value. 291 00:14:59,000 --> 00:15:01,000 So let's use our same example. 292 00:15:01,000 --> 00:15:02,000 And I'm gonna come back. 293 00:15:02,000 --> 00:15:05,000 And I'm gonna add in total revenue. 294 00:15:06,000 --> 00:15:09,000 So now, we're seeing our subcategories, 295 00:15:09,000 --> 00:15:11,000 mountain bikes and road bikes, 296 00:15:11,000 --> 00:15:14,000 for this first six months of 2022. 297 00:15:14,000 --> 00:15:16,000 And we have our total revenue. 298 00:15:16,000 --> 00:15:17,000 If you look at the matrix, 299 00:15:17,000 --> 00:15:19,000 I know it's shrunk down a little bit above. 300 00:15:19,000 --> 00:15:22,000 But you can see that we have 3.3 million 301 00:15:22,000 --> 00:15:25,000 for total revenue for mountain bikes. 302 00:15:25,000 --> 00:15:28,000 And the total grand totals are the exact same. 303 00:15:28,000 --> 00:15:29,000 So far so good. 304 00:15:29,000 --> 00:15:31,000 Everything's exactly the same. 305 00:15:32,000 --> 00:15:34,000 What's really cool here is that 306 00:15:34,000 --> 00:15:36,000 if we come into columns, 307 00:15:36,000 --> 00:15:38,000 we can add in our Time Intelligence 308 00:15:38,000 --> 00:15:42,000 calculation group to columns, 309 00:15:45,000 --> 00:15:50,000 all of our items are added by default 310 00:15:50,000 --> 00:15:51,000 into this visual. 311 00:15:51,000 --> 00:15:54,000 All right, so we have our month-over-month revenue. 312 00:15:54,000 --> 00:15:57,000 And if you look month-over-month to month-over-month, 313 00:15:57,000 --> 00:15:59,000 these values line up. 314 00:15:59,000 --> 00:16:01,000 If you look at previous month revenue 315 00:16:01,000 --> 00:16:03,000 and previous month revenue, 316 00:16:03,000 --> 00:16:04,000 all of these values align, 317 00:16:04,000 --> 00:16:08,000 same thing with quarter-to-date and year-to-date. 318 00:16:08,000 --> 00:16:10,000 So without having to add in all of those 319 00:16:10,000 --> 00:16:15,000 additional time intelligence measures to this visual, 320 00:16:15,000 --> 00:16:17,000 we were able to define it 321 00:16:17,000 --> 00:16:20,000 and just add in that calculation group. 322 00:16:20,000 --> 00:16:21,000 So couple of things here that are kind 323 00:16:21,000 --> 00:16:23,000 of bothering me a little bit. 324 00:16:23,000 --> 00:16:25,000 First thing is the order, right? 325 00:16:25,000 --> 00:16:28,000 I'd like to be in that same exact order. 326 00:16:28,000 --> 00:16:30,000 The other thing is the formatting 327 00:16:30,000 --> 00:16:32,000 on the month-over-month percent change, right? 328 00:16:32,000 --> 00:16:33,000 They're just showing up as dollars. 329 00:16:33,000 --> 00:16:36,000 I'd like to see this as a percentage. 330 00:16:36,000 --> 00:16:38,000 What's cool about the calculation groups is that 331 00:16:38,000 --> 00:16:41,000 when you're referencing the base measure, 332 00:16:41,000 --> 00:16:45,000 these different values take into consideration 333 00:16:45,000 --> 00:16:47,000 the explicit version of that measure, 334 00:16:47,000 --> 00:16:51,000 how it's formatted, and the data type within the model. 335 00:16:51,000 --> 00:16:53,000 So kind of inherits that, 336 00:16:53,000 --> 00:16:54,000 which is why we're seeing these 337 00:16:54,000 --> 00:16:56,000 dollar amounts here for revenue. 338 00:16:56,000 --> 00:16:58,000 So let's jump back over to the model. 339 00:16:59,000 --> 00:17:02,000 And I want to take care of a couple of things. 340 00:17:02,000 --> 00:17:07,000 First, the ordering, and then I wanna define the, 341 00:17:07,000 --> 00:17:09,000 using this dynamic formatting string, 342 00:17:09,000 --> 00:17:12,000 how we're gonna format the month-over-month 343 00:17:12,000 --> 00:17:13,000 percent change measure. 344 00:17:14,000 --> 00:17:17,000 So if we click on our calculation item header, 345 00:17:17,000 --> 00:17:21,000 what's really cool here is this is all drag and drop. 346 00:17:21,000 --> 00:17:25,000 So let's say we just want current measure, previous month, 347 00:17:25,000 --> 00:17:27,000 maybe month-over-month change, 348 00:17:27,000 --> 00:17:30,000 month-over-month percent change, 349 00:17:30,000 --> 00:17:33,000 quarter-to-date, and then year-to-date, right? 350 00:17:33,000 --> 00:17:35,000 So pretty happy with that order. 351 00:17:36,000 --> 00:17:38,000 The next thing that we can do 352 00:17:38,000 --> 00:17:42,000 is if we click on this calculation item, 353 00:17:42,000 --> 00:17:44,000 and then toggle on dynamic format string, 354 00:17:46,000 --> 00:17:47,000 and there's a bunch of different documentation 355 00:17:47,000 --> 00:17:50,000 and help center articles around how to create 356 00:17:50,000 --> 00:17:52,000 dynamic formatting strings. 357 00:17:52,000 --> 00:17:53,000 There's different ways that you can approach 358 00:17:53,000 --> 00:17:56,000 different types of calculations, and all that kind of stuff. 359 00:17:56,000 --> 00:17:59,000 So depending on what you're trying to solve for here, 360 00:17:59,000 --> 00:18:02,000 your solution may look a little bit different than mine. 361 00:18:02,000 --> 00:18:05,000 But very simply, what we wanna do is we're gonna 362 00:18:05,000 --> 00:18:08,000 use the pound sign, and then in decimal point, 363 00:18:08,000 --> 00:18:11,000 and a pound sign, and then a percent sign, right? 364 00:18:11,000 --> 00:18:12,000 So basically, we're saying, 365 00:18:12,000 --> 00:18:16,000 "Hey, we've got two placeholders in front of the decimal, 366 00:18:16,000 --> 00:18:19,000 and then we're gonna have our accuracy 367 00:18:19,000 --> 00:18:23,000 to the hundreds place behind the decimal." 368 00:18:23,000 --> 00:18:24,000 So it's pretty straightforward there. 369 00:18:24,000 --> 00:18:27,000 You can expand this to include, you know, 370 00:18:27,000 --> 00:18:29,000 larger values here, larger percentages, 371 00:18:29,000 --> 00:18:33,000 like if you're getting into the thousands place, 372 00:18:33,000 --> 00:18:34,000 stuff like that. 373 00:18:35,000 --> 00:18:36,000 And then, from here, 374 00:18:36,000 --> 00:18:39,000 let's jump back over to our Report view. 375 00:18:39,000 --> 00:18:42,000 And we can now see that our measures 376 00:18:42,000 --> 00:18:46,000 are all in the same exact order, top to bottom, 377 00:18:46,000 --> 00:18:51,000 and our format for our percentages updated appropriately. 378 00:18:51,000 --> 00:18:54,000 All right, so everything's looking really, really good here. 379 00:18:54,000 --> 00:18:56,000 If we wanted to at this point, 380 00:18:56,000 --> 00:19:00,000 we could actually go through and delete 381 00:19:00,000 --> 00:19:02,000 all of these different measures, right? 382 00:19:02,000 --> 00:19:03,000 We could remove these from the model. 383 00:19:03,000 --> 00:19:05,000 We don't need them anymore, 384 00:19:05,000 --> 00:19:07,000 unless we want to use these specifically 385 00:19:07,000 --> 00:19:09,000 for other calculations, or something like that. 386 00:19:09,000 --> 00:19:11,000 But again, it's a great way to go through 387 00:19:11,000 --> 00:19:13,000 and kind of clean up a lot of the clutter 388 00:19:13,000 --> 00:19:15,000 within your model, if it exists. 389 00:19:16,000 --> 00:19:19,000 I'm gonna remove this top visual here for a moment. 390 00:19:20,000 --> 00:19:23,000 And the last thing that I want to kind of talk about, 391 00:19:23,000 --> 00:19:25,000 and I had hinted at this in the slides, 392 00:19:25,000 --> 00:19:29,000 is that we can actually create a brand new field parameter 393 00:19:29,000 --> 00:19:33,000 to toggle this current or base measure. 394 00:19:33,000 --> 00:19:35,000 So let's go through and quickly set that up. 395 00:19:36,000 --> 00:19:41,000 So we're gonna come up to Modeling, New Parameter, 396 00:19:41,000 --> 00:19:42,000 New Field Parameter. 397 00:19:43,000 --> 00:19:45,000 And I would like to call this 398 00:19:46,000 --> 00:19:49,000 Measure Selector. 399 00:19:50,000 --> 00:19:53,000 And all we need to do is add in the different 400 00:19:53,000 --> 00:19:56,000 measures that we wanna add in here. 401 00:19:56,000 --> 00:20:01,000 So I'm gonna add in total cost, total revenue. 402 00:20:01,000 --> 00:20:06,000 Let's add in total profit, total orders. 403 00:20:08,000 --> 00:20:11,000 And then, how about like quantity sold? 404 00:20:13,000 --> 00:20:14,000 And I'll click Create. 405 00:20:17,000 --> 00:20:19,000 So Power BI is automatically added 406 00:20:19,000 --> 00:20:21,000 this parameter in as a slicer. 407 00:20:22,000 --> 00:20:26,000 And when I select the different values within the slicer, 408 00:20:26,000 --> 00:20:27,000 looks outta that, 409 00:20:28,000 --> 00:20:30,000 see, nothing happens with my visual, right? 410 00:20:30,000 --> 00:20:33,000 Nothing's updating or changing because what I need 411 00:20:33,000 --> 00:20:36,000 to do is I actually need to reference this 412 00:20:36,000 --> 00:20:41,000 parameter within my value section of the visual. 413 00:20:41,000 --> 00:20:43,000 So what we want to do is pull out this total revenue 414 00:20:45,000 --> 00:20:49,000 and update it with the Measure Selector. 415 00:20:51,000 --> 00:20:52,000 So now, look what happens. 416 00:20:52,000 --> 00:20:53,000 We've got total orders here. 417 00:20:54,000 --> 00:20:57,000 You want the quantity sold as your base measure. 418 00:20:57,000 --> 00:20:59,000 That'll update, 419 00:20:59,000 --> 00:21:04,000 total profit, total revenue, total cost. 420 00:21:05,000 --> 00:21:09,000 Again, it's amazing that you're able to now update 421 00:21:09,000 --> 00:21:12,000 a couple of values within your matrix rule. 422 00:21:12,000 --> 00:21:15,000 With a combination of something like this field parameter 423 00:21:15,000 --> 00:21:18,000 and your time intelligence calculation group, 424 00:21:18,000 --> 00:21:21,000 you're really creating a very dynamic visual here 425 00:21:21,000 --> 00:21:23,000 that can help users and, you know, 426 00:21:23,000 --> 00:21:26,000 different team members explore exactly what's going on. 427 00:21:27,000 --> 00:21:28,000 All right, so at this point, 428 00:21:28,000 --> 00:21:31,000 I think you're getting the idea of just how useful 429 00:21:31,000 --> 00:21:34,000 and powerful calculation groups can be within Power BI. 430 00:21:35,000 --> 00:21:37,000 And what's really cool is that with all 431 00:21:37,000 --> 00:21:40,000 of the Power BI team's continued product development 432 00:21:40,000 --> 00:21:42,000 and the evolution of calculation groups, 433 00:21:42,000 --> 00:21:44,000 and items, and visuals, 434 00:21:44,000 --> 00:21:47,000 all of this can be created from desktop, 435 00:21:47,000 --> 00:21:48,000 or within the service environment. 436 00:21:48,000 --> 00:21:50,000 So you've got a bunch of different 437 00:21:50,000 --> 00:21:52,000 flexibility there as well. 438 00:21:52,000 --> 00:21:54,000 All right, so have fun. 439 00:21:54,000 --> 00:21:56,000 Explore this more on your own. 440 00:21:56,000 --> 00:21:58,000 And try out some of the other use cases 441 00:21:58,000 --> 00:21:59,000 for calculation groups. 442 00:21:59,000 --> 00:22:01,000 I'll see you in the next lecture. 443 00:22:01,000 --> 00:22:02,000 Until then, learn on. 34941

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