Advanced - Get Data

Master Power BI Dashboard Excel Power BI Dashboards
13 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$10
List Price:  $199
You save:  $189
€9.60
List Price:  €191.16
You save:  €181.55
£7.82
List Price:  £155.80
You save:  £147.98
CA$14.32
List Price:  CA$285.15
You save:  CA$270.82
A$16.01
List Price:  A$318.70
You save:  A$302.69
S$13.50
List Price:  S$268.74
You save:  S$255.24
HK$77.70
List Price:  HK$1,546.39
You save:  HK$1,468.69
CHF 8.85
List Price:  CHF 176.11
You save:  CHF 167.26
NOK kr112.69
List Price:  NOK kr2,242.57
You save:  NOK kr2,129.87
DKK kr71.73
List Price:  DKK kr1,427.42
You save:  DKK kr1,355.69
NZ$17.68
List Price:  NZ$352.02
You save:  NZ$334.33
د.إ36.72
List Price:  د.إ730.92
You save:  د.إ694.19
৳1,193.10
List Price:  ৳23,742.76
You save:  ৳22,549.66
₹853.97
List Price:  ₹16,994.19
You save:  ₹16,140.21
RM44.87
List Price:  RM892.91
You save:  RM848.04
₦15,455.99
List Price:  ₦307,574.36
You save:  ₦292,118.36
₨2,779.55
List Price:  ₨55,313.12
You save:  ₨52,533.56
฿341.70
List Price:  ฿6,799.83
You save:  ฿6,458.13
₺351.95
List Price:  ₺7,003.86
You save:  ₺6,651.91
B$63.76
List Price:  B$1,268.88
You save:  B$1,205.12
R187.50
List Price:  R3,731.33
You save:  R3,543.82
Лв18.80
List Price:  Лв374.15
You save:  Лв355.35
₩14,572.59
List Price:  ₩289,994.66
You save:  ₩275,422.07
₪36.49
List Price:  ₪726.23
You save:  ₪689.73
₱586.60
List Price:  ₱11,673.34
You save:  ₱11,086.74
¥1,571.74
List Price:  ¥31,277.82
You save:  ¥29,706.07
MX$201.64
List Price:  MX$4,012.67
You save:  MX$3,811.03
QR36.31
List Price:  QR722.60
You save:  QR686.29
P138.66
List Price:  P2,759.41
You save:  P2,620.74
KSh1,290.40
List Price:  KSh25,678.96
You save:  KSh24,388.56
E£508.34
List Price:  E£10,116
You save:  E£9,607.65
ብር1,271.21
List Price:  ብር25,297.26
You save:  ብር24,026.04
Kz9,120
List Price:  Kz181,488
You save:  Kz172,368
CLP$9,892.90
List Price:  CLP$196,868.71
You save:  CLP$186,975.81
CN¥72.99
List Price:  CN¥1,452.50
You save:  CN¥1,379.51
RD$608.17
List Price:  RD$12,102.65
You save:  RD$11,494.48
DA1,351.01
List Price:  DA26,885.16
You save:  DA25,534.14
FJ$23.18
List Price:  FJ$461.41
You save:  FJ$438.22
Q76.90
List Price:  Q1,530.41
You save:  Q1,453.51
GY$2,088.84
List Price:  GY$41,567.99
You save:  GY$39,479.15
ISK kr1,395.50
List Price:  ISK kr27,770.45
You save:  ISK kr26,374.95
DH100.68
List Price:  DH2,003.60
You save:  DH1,902.92
L184.20
List Price:  L3,665.77
You save:  L3,481.56
ден590.93
List Price:  ден11,759.56
You save:  ден11,168.63
MOP$79.87
List Price:  MOP$1,589.43
You save:  MOP$1,509.56
N$185.64
List Price:  N$3,694.36
You save:  N$3,508.72
C$367.38
List Price:  C$7,310.90
You save:  C$6,943.52
रु1,359.77
List Price:  रु27,059.52
You save:  रु25,699.74
S/37.17
List Price:  S/739.84
You save:  S/702.66
K40.52
List Price:  K806.39
You save:  K765.87
SAR37.55
List Price:  SAR747.27
You save:  SAR709.72
ZK276.30
List Price:  ZK5,498.56
You save:  ZK5,222.25
L47.84
List Price:  L952.07
You save:  L904.23
Kč241.81
List Price:  Kč4,812.21
You save:  Kč4,570.39
Ft3,948.26
List Price:  Ft78,570.54
You save:  Ft74,622.27
SEK kr108.82
List Price:  SEK kr2,165.57
You save:  SEK kr2,056.74
ARS$10,270.87
List Price:  ARS$204,390.46
You save:  ARS$194,119.58
Bs68.99
List Price:  Bs1,372.92
You save:  Bs1,303.93
COP$44,128.07
List Price:  COP$878,148.77
You save:  COP$834,020.69
₡5,069.39
List Price:  ₡100,880.97
You save:  ₡95,811.57
L253.67
List Price:  L5,048.06
You save:  L4,794.38
₲77,865.54
List Price:  ₲1,549,524.33
You save:  ₲1,471,658.78
$U444.41
List Price:  $U8,843.80
You save:  $U8,399.39
zł40.94
List Price:  zł814.78
You save:  zł773.83
Already have an account? Log In

Transcript

Okay, now let's start to work with getting our data from this three data sources. Okay, so have your Power BI Desktop open. And what we will do next is let's go to get data. And we want to go and get the data from a website. So let's select web. Okay, so now it's asking for a URL.

So first things first is let's start with our first data source. So we'll be working with the team stats, the traditional team stats, so I'll just be copying the complete URL from here. So I'll just right click Copy, right. And the let's go over here and let's paste it over. Once you have the URL, just go Okay, and it will start to parse or analyze the website on which sets of data you could retrieve from it. Okay, so it will take quite a while but hopefully not that long.

And once you have that ready, we'll explore what data it has in store for us. And what we're after. Definitely is the table right? The table that we're seeing with the teams the point, Okay, then let's see if it's able to get it successfully. Now, you could see here that it got three sets of data here. So let's just select document and see what's in here.

Nope, this is not the one. Let's go to table zero. Yep. If you look here, it looks good, right? This is the games played, wins last, the team names, right? And then if you just scroll over here, and you have all the other statistics, let's go to web view.

Okay. And you could see here, right, it has the same web page that we showed a while ago. And it has highlighted the table correctly over here. Right? So which means this is the part that it retrieved the data from for table zero. So once we're happy with this, okay, this is what we'll be selecting table zero.

Okay, so that looks good. Just out of curiosity, let's have a quick look at table one just to see what it looks like. And this is not the one we're after, right? So we're happy with it. with zero, make sure that's selected. And let's go to Edit.

So once we have that, it's going to be loading it straight to the power query editor window. And now we can work on our transformations. So this prop over here is just showing, so I'll just close this, okay? Because I've already loaded this before when I was working on this exercise, right? And for you, it shouldn't be showing up if it's your first time loading this data. Okay, so I just closed that one, we can just ignore that.

Okay, and the first transformation that we want to do is we want to remove this column over here. This is data that we don't need. So I'll just right click on the column header, and select Remove. So okay, that's remove right now. And then what we're going to be doing next is we want to get the location of the teams over here. Okay, because if you look closely, the formatting over here for the team is dedication, followed by the name Okay, so you have Houston as the location.

And then your team name is rockets. Okay? Same thing as well, Golden State as the location warriors is the team name over here. So the pattern just repeats for every single team over here. So what we're going to be doing is we will be transforming this column, right? And splitting it by the space, okay, so that we can get the occasion and then the team name afterwards.

But the question right now is what do we do with the occasions that have to write two words over here, so for example, Golden State, so what we're going to be doing is we're going to be splitting it by the rightmost space, okay? So which means this space over here, we're going to be splitting it to another column, right? Same thing as well for that, say, Oklahoma City, right, we're going to be splitting the tunder out right with the rightmost space. So what we'll do right now is transform and go to the split column by delimiter. And if we look here, right, we want to split by space and make sure it's the rightmost delimiter. Once you're good with this, select OK. And just like that, you've already split the column into two.

And you have the team names over here. And you have the locations over here. Okay, so if we scroll down, it's looking good at the moment, except for one thing, right? One of the records don't look like a location, which is this one port on Trail Blazers, because the team name is actually trailblazers, and the location is Portland. This is the only team that has a team name of two words. Okay?

If you look at the others, they're all looking good, except for this one. Okay. So the question now is, what should we do? Okay. So, this is one thing that's very nice with Power Query, because even though if something doesn't look right, if you did the initial step, you made some assumptions and this look right, right. You could move back a step right?

You could move to another step actually, and what we're going to be doing. So let's move a step back up over here before we did the splitting. So this is the step where we remove the numerical column, right? And I'll be doing any additional change over here. So what I'll be doing is for the Portland Trailblazers, just to make the formatting is consistent with the rest of the team names. I'll be changing the trail space blazers into just a single word of trail blazers, okay, without a space.

So what we'll be doing right now is I'll stick with transform, and then I'll go to replace values. Okay, so he's just saying, Do you want to insert a step midway, okay, because we're, we're editing it right? In this step over here, and that's perfectly fine. Okay, so I'll just go insert, and what I want to find is the value of trail blazers and change it to get out of the space. Okay, we're happy Have a desk, okay? And if you look now, it's now trailblazers is one word.

And here's the cool thing. You don't need to split it again. Because what power query will do now is since we have the split step defined, if you click here, you could see that it applied the same transformation. Okay? And it was able now to split it successfully because trailblazers now doesn't have a space in between. So the right will space, okay, it was able to split it correctly.

And now, it works great for everything. So the cool thing with Parkway is it was able to apply it right, we made the change midway but it was able to apply the steps even afterwards. So there was no need for us to redo it. Okay. So now we're happy with this. Okay, the splitting looks great.

Now we need to do some renaming on the columns just to make it better. So I'll just double click on the column name and type location in here. Let's go to Team two and change it to team. Okay, and then Just to make it look better, that's changed this GP two games. Okay, so we're done with this. And before I forget, let's rename as well, this name over here two teams.

That's because table zero is not really that descriptive. So you could see once I change this table zero over here in the queries rights section, also change to Team stats. So it's looking good for a first data source. And now we'll be working on the next one, which is team defense. Oh, and before I forget, I mentioned a while ago that we only want to keep until points. And we want to remove all of the columns until the very end.

So what we're going to be doing is, this is the column that we don't need. Make sure that selected, right, let's scroll over to the right, hold Shift, and click the last column, right. And then we can remove all of them. So let's just go to home, select remove columns, and there you go. We have a much Smaller and cleaner table. Okay, so we're good with Team stats, let's jump over to the next data source, which is team defense.

So let's go over to this page. So this is team defense with our defensive rating over here. So what I'll do is, let me just copy this URL. Let's go back to our Parkway. And okay, you can actually add a new source as well in this window. So just go to new source, same thing, select web.

And then let's paste in our URL here for the defensive stat or defensive rating, and wait for the retrieval to complete. So it's going to be the same steps actually. So now we have our document. Okay. So let's just check if it has the defense rating. Okay, that's looking good.

So we're good with this document is this data over here? Let's just tick it. Let's go okay. And let's see if it's able to load it correctly. Okay, now, let's look Good, we have the number we have the location. So just make sure whenever you load something from a web page, just double check the sources, right, and just make sure that it has the correct data.

Because sometimes it behaves differently, you might be seeing a different list. But in that list, one of the tables are one of the items in there would have your data so you would just be following the same steps and just select it and then load it in here. Okay, so now once we have it in here, what will we be doing is let's make the same transformation. So let me just right click here, remove, can actually go to Home remove columns as well. So let's do that. Once you have that removed, we'll be doing the same steps right for the getting the location in here.

So we'll be replacing first let's go to transform let's change the trailblazers okay to have a no space in between. Okay, so let's replace values, Trail Blazers, okay. And then put it Without a space, okay, so that the format will be consistent across all of the team names. Now let's go to split column delimiter. And now we'll be splitting it by the right space. Go okay.

And there we have it. Okay, let's double click, rename location. Same thing here, double click, rename it to team. And what we're after is just this the defensive rating. So we don't need all this data, just select this column over here. Let's move all the way to the right, hold Shift, right click here and go remove columns.

Now, we have it cleaned up. It's looking good for this one, and let's rename it to team defense. Okay, now we have two queries ready? Team stats, team defense. Now let's jump over to the third one. Let's go to Team clutch and see what's gonna happen next.

Now let's jump over to Team club. Over here, and let's just copy the URL copy. And let's jump over here. And you should know the drill by now let's go to new source and select web. And we'll be pasting in our last and third data source. Let's go okay.

And once you have it loaded, let's have a look now and see if the clutch stats are being displayed over here. And Yep, for document. Looking good. We have the number of clutch games played over here. Okay, so this is what we're after we have all of the team names as well, that select this and go okay. Okay, now, it's just removed the notification.

We now have our data lifted here. Okay, so it's looking good. Now we'll be doing the same transformation. Let's just remove this column, right click Remove. That's changed Trailblazer again, it's going to transform or place value. Okay.

Then Trail Blazers, Trail Blazers without a space, go, okay. And we'll be splitting this column. So you should know the drill by now, right more space, go okay. And let's rename this to occasion, rename this to team. And then we can also rename the games played over here to touch games. Okay.

And then what we can do is let's just keep all of the data until the win percentage. So I'll just go here, select this column, hold Shift, select until the very end, and right click, remove columns. Now we're good with the data. just rename this to Team clutch. And we're good to go. So now we're pretty happy with all of the data that we have, right?

And what we're going to be doing next is we're going to be loading this data sources into our data model.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.