Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:05,040 --> 00:00:06,540
Welcome to the section.
2
00:00:06,540 --> 00:00:09,810
In this section, we're going to be focusing on building our data model.
3
00:00:09,810 --> 00:00:13,640
So we're going to be looking at the underlying data that is giving us the results.
4
00:00:13,650 --> 00:00:17,940
So we've seen earlier on in the course that we can easily create visualizations to see the results of
5
00:00:17,940 --> 00:00:18,660
our data.
6
00:00:18,660 --> 00:00:23,070
So now we're going to look at how we can enhance our data and create these new calculations.
7
00:00:23,400 --> 00:00:23,580
Okay.
8
00:00:23,670 --> 00:00:26,890
So we're going to start off actually using a new data file for this.
9
00:00:26,910 --> 00:00:32,790
Now, if you just start a new Power BI desktop, you will see that you do get import data from Excel
10
00:00:32,790 --> 00:00:34,560
as one of the options straight on the screen.
11
00:00:34,560 --> 00:00:37,680
So I'm actually going to select that and we're going to go jump straight into that.
12
00:00:37,920 --> 00:00:38,190
Okay.
13
00:00:38,190 --> 00:00:42,900
So once you've selected that, please navigate to where you've downloaded all the training data and
14
00:00:42,900 --> 00:00:45,510
we're going to be using the file called training sample.
15
00:00:46,140 --> 00:00:50,490
So if you can just select that file, click on the open button and again, you'll see that it will make
16
00:00:50,490 --> 00:00:54,150
a connection now through to this data file and it brings up our navigator.
17
00:00:54,330 --> 00:00:57,000
So again, we can actually see a preview of this data.
18
00:00:57,030 --> 00:01:01,740
Now, remember, when we see the blue line on top, that means that it's a table of data versus if we
19
00:01:01,740 --> 00:01:04,440
see the little tabs, that means that it's a sheet of data.
20
00:01:04,440 --> 00:01:07,290
So again, we're going to use the table of data, we're going to select that.
21
00:01:07,290 --> 00:01:10,110
And we can see we're going to preview the data look pretty good.
22
00:01:10,560 --> 00:01:13,110
Now, in this case, again, we're going to be using the load button.
23
00:01:13,110 --> 00:01:15,810
So we're just going to click on load and we're going to select that.
24
00:01:16,410 --> 00:01:16,560
Okay.
25
00:01:16,680 --> 00:01:20,640
So yet again, our data is now going to be loaded into our Power BI desktop.
26
00:01:21,120 --> 00:01:25,770
Here we've got the data loaded and we can see on the right hand side that we've got a new set of fields
27
00:01:25,770 --> 00:01:29,460
and you can see that we've got a table and we've got these different field names that we're going to
28
00:01:29,460 --> 00:01:30,360
be using.
29
00:01:30,570 --> 00:01:34,530
So as I said in this section, we're going to be spending a bit more time on the data model.
30
00:01:34,530 --> 00:01:36,390
So what I'm going to do is actually jump across.
31
00:01:36,420 --> 00:01:38,610
We're going to go to our navigation on the left hand side.
32
00:01:38,610 --> 00:01:42,990
We're going to click on data and we're going to bring up that spreadsheet view that we saw earlier on
33
00:01:42,990 --> 00:01:43,860
in the course.
34
00:01:44,370 --> 00:01:46,860
And we're going to see a few things that we can actually do here.
35
00:01:46,950 --> 00:01:50,910
Now, when you go across to the right hand side, you will see that when you actually right click on
36
00:01:50,910 --> 00:01:55,280
one of the fields, that it actually gives you a number of options that you can use.
37
00:01:55,290 --> 00:01:57,750
It gives you your context sensitive menu.
38
00:01:57,810 --> 00:02:02,220
So you can see that we can create things called new measures, new columns, new quick measures, refreshed
39
00:02:02,220 --> 00:02:05,610
data, adding query to a whole bunch of different options that can do.
40
00:02:05,880 --> 00:02:08,880
Also, you'll see at the top that we do get now a new menu.
41
00:02:08,880 --> 00:02:11,009
In this case, it's showing us the table tools.
42
00:02:11,160 --> 00:02:16,110
And what you'll see is that my table name is actually just called table one, so I'm only going to change
43
00:02:16,110 --> 00:02:19,830
the name of that and we're going to call this at our data table.
44
00:02:19,830 --> 00:02:24,960
So I'm going to just change the name press enter and you'll see straight away that that now has changed
45
00:02:24,960 --> 00:02:26,400
the name to data.
46
00:02:26,880 --> 00:02:26,970
Okay.
47
00:02:27,060 --> 00:02:29,280
So that's just how we change a table name.
48
00:02:29,280 --> 00:02:32,940
You could go ahead and you could change any of these field names just as easily.
49
00:02:32,940 --> 00:02:37,320
So clicked on this one could come in here and you could change the name if you wanted to.
50
00:02:37,350 --> 00:02:40,980
Now, in this case, we don't have any need to, but if you wanted to, you could.
51
00:02:41,550 --> 00:02:43,230
Okay, So we're going to accept that data.
52
00:02:43,230 --> 00:02:45,220
We're going to start off with the data.
53
00:02:45,240 --> 00:02:49,680
Now, what we're going to be looking at is how do we create a calculation within this?
54
00:02:49,800 --> 00:02:54,810
So if we look at the data itself, you'll see that we have a list price and we have an order quantity.
55
00:02:55,170 --> 00:02:59,910
Now, if we were to take our list price and we were to multiply by our order quantity, that would give
56
00:02:59,910 --> 00:03:01,620
us what our sales amount is.
57
00:03:01,620 --> 00:03:03,540
So we're going to create a new column.
58
00:03:03,540 --> 00:03:08,310
And what's going to happen is you're going to see that a new column is going to be created on the outside
59
00:03:08,310 --> 00:03:09,090
over here.
60
00:03:09,090 --> 00:03:13,800
And what it's going to do is it's then going to compute a result for each row in the table.
61
00:03:14,190 --> 00:03:17,400
So this is actually called a new calculated column.
62
00:03:17,400 --> 00:03:21,570
And you can see at the top under our table tools that we do get the ability to be able to create this
63
00:03:21,570 --> 00:03:22,410
new column.
64
00:03:22,800 --> 00:03:22,970
Okay.
65
00:03:23,040 --> 00:03:26,370
So we're going to select that and say we want to create a new column.
66
00:03:26,370 --> 00:03:29,850
And you can see now that the column has been created on the outside.
67
00:03:29,850 --> 00:03:32,250
And at the moment it's just got the column name.
68
00:03:32,550 --> 00:03:37,830
You can also see that we've now got our formula bar and it's got the word column equals in there, just
69
00:03:37,830 --> 00:03:38,970
like you would with Excel.
70
00:03:38,970 --> 00:03:42,480
It's a similar, very similar to using the formula bar in Excel.
71
00:03:42,810 --> 00:03:49,350
Now when we're creating a new column within Power BI, what we need to do is we need to give it a name
72
00:03:49,350 --> 00:03:52,410
so every field always has a name within power.
73
00:03:52,740 --> 00:03:57,060
So just because we're creating a new column here, we're going to say we're going to call it sales.
74
00:03:57,060 --> 00:04:00,240
And then you always start your formula by saying equals.
75
00:04:00,240 --> 00:04:03,720
So again, very similar to your Excel where we're using our equals.
76
00:04:03,930 --> 00:04:07,590
Now in this case you can have spaces between your equals or no spaces.
77
00:04:07,590 --> 00:04:09,180
It doesn't really make any difference.
78
00:04:09,180 --> 00:04:12,000
I'm going to put a space in just so that it's easier to read.
79
00:04:12,210 --> 00:04:17,130
Now what we want to do in this is we want to actually say that we want to take our list price and we
80
00:04:17,130 --> 00:04:19,260
want to multiply it by our order quantity.
81
00:04:19,860 --> 00:04:24,540
Now, when it comes to choosing a field, we can use the left square bracket.
82
00:04:24,540 --> 00:04:29,760
So when I press the left square bracket, you'll see that a list of fields actually appears on my formula
83
00:04:29,760 --> 00:04:30,210
ball.
84
00:04:30,330 --> 00:04:32,850
So all it did press the left square bracket.
85
00:04:32,880 --> 00:04:37,740
Now, if I want to go to all the fields that begin with l, I just press the L and you can see now it
86
00:04:37,740 --> 00:04:40,350
shows me only one field, which is my list price.
87
00:04:40,350 --> 00:04:45,030
So I can actually now select that by just clicking on it and it will now actually put the list price
88
00:04:45,030 --> 00:04:45,540
in there.
89
00:04:45,930 --> 00:04:50,540
So we're saying sales equals the list price and we need to tell it to multiply.
90
00:04:50,550 --> 00:04:51,720
Again, I'm going to use a space.
91
00:04:51,720 --> 00:04:53,070
You don't have to use a space.
92
00:04:53,070 --> 00:04:56,760
So we're going to use our asterisk as our multiplication sign.
93
00:04:57,120 --> 00:05:00,720
And again, now I want to now say it's going to be multiplied by the order quantity.
94
00:05:01,330 --> 00:05:04,720
So again, now I could use the left square, select that.
95
00:05:04,720 --> 00:05:07,180
And in this case, it's going to be all the quantity I can press.
96
00:05:07,180 --> 00:05:07,660
Oh.
97
00:05:07,690 --> 00:05:11,410
And you can see now it's only showing me the order quantity field.
98
00:05:11,560 --> 00:05:12,620
So I'm going to select that.
99
00:05:12,640 --> 00:05:14,620
So you can see that this formula is very simple.
100
00:05:14,620 --> 00:05:18,940
It's just saying sales equals our list price multiplied by or the quantity.
101
00:05:19,420 --> 00:05:24,700
When I press enter on this, you'll see now that the calculation is now done row by row.
102
00:05:24,820 --> 00:05:29,350
And this is really the big difference that we're going to see, that when we're creating a new column,
103
00:05:29,350 --> 00:05:34,990
you're always creating a column within the table and it will always produce a row by row result.
104
00:05:34,990 --> 00:05:39,040
So we can go across to each one of these rows and we could see what the list price is multiplied by
105
00:05:39,040 --> 00:05:41,740
the quantity and see what the result of this is.
106
00:05:41,920 --> 00:05:46,420
The moment you can see that the amounts are all the same, but it does change later on down the data
107
00:05:46,420 --> 00:05:46,810
set.
108
00:05:47,680 --> 00:05:50,080
So we've now got this new field called sales.
109
00:05:50,290 --> 00:05:54,630
Now you'll remember that we can actually use this field in our reports.
110
00:05:54,640 --> 00:05:58,200
And the beauty of this is that it's just used like any other field.
111
00:05:58,210 --> 00:06:04,300
So if I go back to my report and we say, now we want to build a new table, so we choose our table
112
00:06:04,300 --> 00:06:06,070
visualization, select that.
113
00:06:06,750 --> 00:06:09,440
And in this case, what we're going to use is we're going to use a subregion.
114
00:06:09,450 --> 00:06:11,400
A subregion is actually a list of countries.
115
00:06:11,400 --> 00:06:13,440
So that's there's a subregion.
116
00:06:13,440 --> 00:06:17,970
And now you'll see that my sales field is now being in my list of fields.
117
00:06:17,970 --> 00:06:20,070
So if I want to use that, I can select it.
118
00:06:20,100 --> 00:06:22,440
Just one thing to note, it does get a different icon.
119
00:06:22,440 --> 00:06:28,260
So that icon is actually showing me that it is a calculated column, so it's not native to the table
120
00:06:28,260 --> 00:06:29,580
like these other fields were.
121
00:06:29,910 --> 00:06:35,340
But when I drag this in, you'll see that automatically the system now do the calculation and you can
122
00:06:35,340 --> 00:06:37,890
see that we get the results of the totals.
123
00:06:38,220 --> 00:06:41,070
Now, one of the things that you might notice straight away is of formatting.
124
00:06:41,070 --> 00:06:42,830
We got all of these decimal numbers.
125
00:06:42,840 --> 00:06:46,830
Now when it comes to formatting, this works exactly the same as it did earlier on in the course.
126
00:06:46,830 --> 00:06:51,210
If I select this field, you'll see now that I can change could actually change the name of it.
127
00:06:51,210 --> 00:06:53,520
It changed the data type formatting of it.
128
00:06:53,520 --> 00:06:57,960
You see, you get different types of formats that you can use, but you'll remember with your formatting
129
00:06:57,960 --> 00:06:59,870
we could use 1000 separator.
130
00:06:59,880 --> 00:07:04,140
So I'm going to select that with my comma and now it gives me two decimal points.
131
00:07:04,140 --> 00:07:06,330
I'm going to say I want zero decimal points.
132
00:07:06,750 --> 00:07:11,640
And as I say, just like earlier on in the course, now that it has created this as the default for
133
00:07:11,670 --> 00:07:12,870
that sum of cells.
134
00:07:13,710 --> 00:07:18,750
You'll also see that if I go here and I click on the dropdown, that I get the ability to change my
135
00:07:18,750 --> 00:07:22,250
method of aggregation so I can do my average, my min, my max.
136
00:07:22,260 --> 00:07:27,990
So if I said what is my minimum sales amount, show me my minimum sales amount, I go to my average.
137
00:07:28,170 --> 00:07:33,510
So this works again, just like it would exactly earlier on in the course with our fields.
138
00:07:34,050 --> 00:07:36,390
So just one other point to note out as well.
139
00:07:36,390 --> 00:07:41,990
With the sales field at the moment, it's said to be the same as the default summarization.
140
00:07:42,000 --> 00:07:45,870
So just remember, if you wanted to change this to another method of aggregation, you could do that
141
00:07:45,870 --> 00:07:46,500
as well.
142
00:07:47,370 --> 00:07:47,580
Okay.
143
00:07:47,580 --> 00:07:50,520
So I'm going to change this back to some of sales.
144
00:07:50,520 --> 00:07:52,860
And now we've got some sales there.
145
00:07:52,890 --> 00:07:55,950
Let's go back to a data model and have a look at our data.
146
00:07:56,160 --> 00:07:59,100
Now, let's say I wanted to know what was my total cost.
147
00:07:59,280 --> 00:08:02,210
And you can see I've got my unit price and I've got my order quantity.
148
00:08:02,220 --> 00:08:04,980
And basically I would do exactly the same format.
149
00:08:05,010 --> 00:08:10,890
Now, what I could do is I could use new column from this option in the ribbon, or I could go across
150
00:08:10,890 --> 00:08:15,860
to my table, I could right click on this and actually, let's choose the three ellipses.
151
00:08:15,870 --> 00:08:16,470
There we go.
152
00:08:16,470 --> 00:08:20,960
The three ellipses, you'll see that you get a new column option so you could use either or.
153
00:08:20,970 --> 00:08:22,660
Now, in this case, I'm going to choose new column.
154
00:08:22,680 --> 00:08:26,510
Now, please make sure at this point, remember, we're creating a new calculated column.
155
00:08:26,520 --> 00:08:27,900
Do not choose new measure.
156
00:08:27,900 --> 00:08:31,050
We're going to do that in the next section and you're going to see something quite different.
157
00:08:31,260 --> 00:08:34,860
So we're going to click on new column and again, we're going to get our formula bar.
158
00:08:34,860 --> 00:08:38,090
And in this case, we're going to say we want to know what our total cost is.
159
00:08:38,100 --> 00:08:39,510
I'm going to say equals.
160
00:08:39,539 --> 00:08:41,640
Now, in this case, we want a unit price.
161
00:08:41,640 --> 00:08:44,020
So again, I'm going to press my left square bracket.
162
00:08:44,039 --> 00:08:45,270
I'm going to press you.
163
00:08:45,270 --> 00:08:47,910
And it will show me that I have my unit price field.
164
00:08:47,910 --> 00:08:53,010
And in this case, we're going to be saying, I want to multiply that again f square bracket by my order
165
00:08:53,010 --> 00:08:53,870
quantity.
166
00:08:53,880 --> 00:08:56,940
And you can see once you get the hang of this, it's pretty quick and easy.
167
00:08:57,150 --> 00:08:57,840
So there we go.
168
00:08:57,840 --> 00:09:01,950
We got our cost equals the unit price multiplied by the order quantity.
169
00:09:02,130 --> 00:09:03,810
Again, I could accept that.
170
00:09:03,900 --> 00:09:06,870
And from here now, I could actually change the formatting.
171
00:09:06,870 --> 00:09:08,850
So I've got the cost field selected.
172
00:09:08,850 --> 00:09:13,950
You can see it's highlighted over here and we could just go into a formatting and we could change the
173
00:09:13,950 --> 00:09:14,680
default there.
174
00:09:14,760 --> 00:09:18,000
And you can see that it's updated at U on this model again.
175
00:09:18,000 --> 00:09:24,090
Now if I went back into my report, I can just choose my cost Now drag that into the visualization and
176
00:09:24,090 --> 00:09:24,560
there we go.
177
00:09:24,570 --> 00:09:26,310
You can see that the cost has been added.
178
00:09:26,820 --> 00:09:26,940
Okay.
179
00:09:27,030 --> 00:09:29,040
One last one that we're going to look at in this lesson.
180
00:09:29,040 --> 00:09:30,990
So we're going to go back to our data.
181
00:09:31,140 --> 00:09:33,920
Now, let's say we wanted to say we want to know profit.
182
00:09:33,930 --> 00:09:36,970
Now a profit would be our sales minus our cost.
183
00:09:36,990 --> 00:09:42,660
Now, these are two calculated columns, but we can use them actually in other calculations as well.
184
00:09:42,660 --> 00:09:47,370
So I could create a new field, which I'm going to do now called my profit and say, I want to take
185
00:09:47,370 --> 00:09:49,950
my profit, which is my sales minus my cost.
186
00:09:50,640 --> 00:09:51,720
So again, let's do that.
187
00:09:51,720 --> 00:09:54,600
In this case, I'm just going to use this option to create the new column.
188
00:09:54,790 --> 00:09:56,370
So I'm going to say new column in this case.
189
00:09:56,390 --> 00:10:01,560
Again, you can see that it's created column and we're going to say that this is our profit field and
190
00:10:01,560 --> 00:10:02,500
be equals.
191
00:10:02,520 --> 00:10:08,670
Now, again, when I press my left square bracket, you'll see that sales is now one of the options
192
00:10:08,670 --> 00:10:11,640
that I've got to select because it's now a field within my table.
193
00:10:11,910 --> 00:10:13,350
So I'm going to select sales.
194
00:10:13,350 --> 00:10:16,260
I'm going to say that we want to minus again.
195
00:10:16,260 --> 00:10:19,750
Now, when I look here, I'll see the cost is actually a field as well.
196
00:10:19,770 --> 00:10:23,490
So now I can say profit equals my sales minus my cost.
197
00:10:23,730 --> 00:10:25,050
So we're going to accept that.
198
00:10:25,140 --> 00:10:25,980
Press enter.
199
00:10:26,190 --> 00:10:28,380
We now go profit as a new field.
200
00:10:28,380 --> 00:10:35,400
And again, I could do my formatting thousand separator, no decimal places, go back to my report.
201
00:10:35,640 --> 00:10:39,570
And now by each of my countries I can now say profit.
202
00:10:39,780 --> 00:10:40,860
Drop it in there.
203
00:10:41,070 --> 00:10:41,850
And there we go.
204
00:10:41,850 --> 00:10:45,600
We now got the sum of the profit by each of the countries as well.
205
00:10:45,810 --> 00:10:46,590
So there we go.
206
00:10:46,590 --> 00:10:49,980
That's an introductory lesson to creating calculated columns.
207
00:10:49,980 --> 00:10:51,420
We're going to continue in the next lesson.
208
00:10:51,420 --> 00:10:52,740
I'm going to look at some dates.
209
00:10:52,740 --> 00:10:54,240
I will see you in that lesson.
20682
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.