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.59
List Price:  €191.01
You save:  €181.41
£7.98
List Price:  £158.83
You save:  £150.84
CA$13.98
List Price:  CA$278.27
You save:  CA$264.28
A$15.37
List Price:  A$306.01
You save:  A$290.63
S$13.46
List Price:  S$267.97
You save:  S$254.50
HK$77.84
List Price:  HK$1,549.10
You save:  HK$1,471.26
CHF 8.93
List Price:  CHF 177.82
You save:  CHF 168.88
NOK kr110.72
List Price:  NOK kr2,203.44
You save:  NOK kr2,092.72
DKK kr71.58
List Price:  DKK kr1,424.50
You save:  DKK kr1,352.91
NZ$17.13
List Price:  NZ$341.07
You save:  NZ$323.93
د.إ36.73
List Price:  د.إ730.92
You save:  د.إ694.19
৳1,194.68
List Price:  ৳23,774.19
You save:  ৳22,579.51
₹844.38
List Price:  ₹16,803.23
You save:  ₹15,958.84
RM44.68
List Price:  RM889.13
You save:  RM844.45
₦16,928.83
List Price:  ₦336,883.74
You save:  ₦319,954.91
₨2,778
List Price:  ₨55,282.20
You save:  ₨52,504.20
฿344.66
List Price:  ฿6,858.76
You save:  ฿6,514.10
₺345.52
List Price:  ₺6,875.94
You save:  ₺6,530.42
B$58.01
List Price:  B$1,154.39
You save:  B$1,096.38
R181.15
List Price:  R3,604.94
You save:  R3,423.79
Лв18.77
List Price:  Лв373.54
You save:  Лв354.77
₩14,045.10
List Price:  ₩279,497.49
You save:  ₩265,452.39
₪37.02
List Price:  ₪736.69
You save:  ₪699.67
₱589.39
List Price:  ₱11,728.86
You save:  ₱11,139.47
¥1,547.70
List Price:  ¥30,799.23
You save:  ¥29,251.53
MX$204.28
List Price:  MX$4,065.27
You save:  MX$3,860.98
QR36.46
List Price:  QR725.56
You save:  QR689.10
P136.72
List Price:  P2,720.73
You save:  P2,584.01
KSh1,294.68
List Price:  KSh25,764.28
You save:  KSh24,469.59
E£496.50
List Price:  E£9,880.38
You save:  E£9,383.88
ብር1,223.88
List Price:  ብር24,355.40
You save:  ብር23,131.51
Kz9,130
List Price:  Kz181,687
You save:  Kz172,557
CLP$9,866.80
List Price:  CLP$196,349.32
You save:  CLP$186,482.52
CN¥72.43
List Price:  CN¥1,441.35
You save:  CN¥1,368.92
RD$602.52
List Price:  RD$11,990.22
You save:  RD$11,387.70
DA1,342.75
List Price:  DA26,720.72
You save:  DA25,377.97
FJ$22.75
List Price:  FJ$452.91
You save:  FJ$430.15
Q77.17
List Price:  Q1,535.73
You save:  Q1,458.56
GY$2,091.55
List Price:  GY$41,622.02
You save:  GY$39,530.46
ISK kr1,396.80
List Price:  ISK kr27,796.32
You save:  ISK kr26,399.52
DH100.57
List Price:  DH2,001.42
You save:  DH1,900.84
L182.21
List Price:  L3,626.11
You save:  L3,443.89
ден590.47
List Price:  ден11,750.54
You save:  ден11,160.06
MOP$80.15
List Price:  MOP$1,595.11
You save:  MOP$1,514.95
N$181.30
List Price:  N$3,607.87
You save:  N$3,426.57
C$367.86
List Price:  C$7,320.57
You save:  C$6,952.70
रु1,350.16
List Price:  रु26,868.20
You save:  रु25,518.04
S/37.90
List Price:  S/754.40
You save:  S/716.49
K40.25
List Price:  K801
You save:  K760.75
SAR37.54
List Price:  SAR747.13
You save:  SAR709.58
ZK276.45
List Price:  ZK5,501.49
You save:  ZK5,225.03
L47.78
List Price:  L950.86
You save:  L903.07
Kč243.26
List Price:  Kč4,840.91
You save:  Kč4,597.65
Ft3,950
List Price:  Ft78,605
You save:  Ft74,655
SEK kr110.36
List Price:  SEK kr2,196.20
You save:  SEK kr2,085.84
ARS$10,038.49
List Price:  ARS$199,766.10
You save:  ARS$189,727.60
Bs69.08
List Price:  Bs1,374.73
You save:  Bs1,305.64
COP$43,897.49
List Price:  COP$873,560.24
You save:  COP$829,662.74
₡5,092.37
List Price:  ₡101,338.21
You save:  ₡96,245.84
L252.64
List Price:  L5,027.56
You save:  L4,774.92
₲78,046.70
List Price:  ₲1,553,129.39
You save:  ₲1,475,082.69
$U426.22
List Price:  $U8,481.88
You save:  $U8,055.65
zł41.63
List Price:  zł828.54
You save:  zł786.90
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.