★ Get the example file ★ Sign up for our free Insiders program and get the example file: https://exceloffthegrid.com/insiders-signup/ File Reference for this video: 0321 PQ Advanced Options
0:00 Group By and Replace Values
5:28 Pivot and Split Column
7:41 Text Extraction and Advanced Options
This video explores the \"Advanced\" toggle in Power Query, arguing that these options are not actually complex but are simply useful features hidden from view. Through five practical examples, the presenter demonstrates how accessing these settings can significantly enhance data transformation efficiency.
I can't take full credit for this video. I was inspired by a conversation that we had on the
UnPivot podcast, where we discussed how the advanced features in Power Query aren't actually
advanced. Instead, they just hide away really useful features. And this got me thinking about
which options are hidden behind the advanced toggle. So make sure you watch to the end,
because it may be the solution you need is right there.
But if you've never clicked advanced before, you wouldn't even know it's there.
Here is our example file. And if you want to work along with this video,
then you can follow the links in the video description box below.
We're using the same data for all five examples. And we also have five columns.
We have month end, item, sizes, which contains multiple values separated by a comma and a space.
Then we have location and value. That's our data.
Now let's go make a start with our first example. All of the examples that we're looking at in this
video are from the transform tab. And we're starting with the first item on that tab,
which is group by. Let's suggest we want to group by our item column. We select item,
and we go to group by. Now in here, we have the option to select a single column and to
create a single aggregation. But there is this advanced option. What does advanced do?
Well, when we click that, it just means we can add more groupings and more aggregations.
So let's add another grouping. Let's group by our location. And let's add another aggregation.
We've got count. Let's also add the sum. I'll select sum from there. And let's add one more
average. We can select average from there. We do need to select our columns, which are going to be
our value column in both scenarios. Now advanced also gives us the option to move our groupings
up and down and also our aggregations up and down. But when we click OK, that now groups by
those values. But why did we even need a basic and advanced option? Because if we delete that step,
if we select two columns at the start and then go to group by, it automatically opens
on the advanced option. So why do we even need a basic option? There isn't a huge difference
between basic and advanced. And really, we just get away with basic because advanced isn't actually
that difficult. For our second example, we're going to look at replace values. I'm going to
select the item column and then from the transform ribbon, I'll select replace values. In there,
we have the value to find and the value to replace with. We also have the advanced options.
So we've got other options in here that we might want to use, but these aren't particularly advanced
options. Let's say the value we want to find is alpha and we want to replace with apple.
When I click OK, that replaces every instance of alpha with apple. But let's suggest that we only
want to replace where the full cell value is alpha. We want apple plus to remain exactly the same.
Let's click on the gear icon to edit that step, come to the advanced options, select match entire
cell contents, click OK, and now it only changes the entire cell contents. It doesn't change if
there is a partial match. Let's go and take a look at the other option. With that item column
selected again, I'll go to replace values. Let's take a look at the advanced options and we have
replace using special characters. So I'm going to insert a line feed and let's suggest I want
to replace a space with a line feed. I'll click OK. Now at the moment, it doesn't look like there's
any change, but if we click on the preview of that cell, we can see that there is a line break
now between alpha and plus, when if we come back to the previous step, you'll notice they're both
in the same row. If we come to view and select to show white space, we will actually see that
with inside that step. So when we change to the next step, you can see alpha and plus is now on
two separate lines. So that's the advanced options inside the replace values. Again,
they're not that advanced. They're the things we might want to use on a regular basis. For our
third example, we're looking at the pivot transformation. In here, I'm going to start
by deleting the month end and size columns, just so that we have less columns to work with
for our example. I now have the location column selected and let's suggest that we want these
location values to be across each column. I'll click pivot column and then it asks us, well,
which column contains the values? That is our value column. That means we'll get item along
the left, location across the top and the values in the middle. We also have this advanced options.
So let's toggle that off. I'll click okay. And what we get here is the sum of those values.
So for example, where we have West and Charlie, there are multiple values that meet that criteria.
Therefore, the sum is 147. But what if we don't want a sum? Well, that's all the advanced options
are for. Go to advanced and all this contains is the different aggregation options. Again,
this isn't anything advanced. Let's select average. I'll click okay. And now that value
comes down to 73.5. So in our pivot feature, all advanced does is contain what kind of
aggregation we want to do when there are multiple instances of our item and also our location.
For our next example, we're going to click on the subscribe button and get notifications.
Now, this is not an advanced feature, but it gives you lots of benefits because
then you won't miss any of our future videos. So what are you waiting for? It's probably the
easiest thing and the best thing that you'll do today. For our fourth example, we're looking at
the split column feature. I'm going to select the sizes column, which has multiple sizes
separated by a comma and a space. I'll then click on the split column drop down. Now,
each of the first three items roughly have the same advanced features. I'm going to select the
first one, which is by delimiter. Now, interestingly in here at the bottom, we have split using
special characters. Now, when we replace values, this was an advanced feature, but here splitting
a column by delimiter, this is not an advanced feature. If you want to use this, we come down
to custom, we can select the split using special characters, and then we can choose which special
character we want to use. So that's not an advanced option in this dialog. I'm going to
change this back to, we're going to use custom and we want a comma and a space. So what is in
the advanced options? If we click in there, you can see we have options to split by columns. That's
the default. And then we could declare the number of columns that we want to split by. And if we
have any excess items, so here we have three, but if we had four items that we wanted to split,
it wouldn't include that last item. It would only include the first three. But that's not the most
useful feature in here. The most useful is rows. However, when we click this, that split by into a
specific number disappears. It exists for columns, but it doesn't exist for rows. But let's take a
look. We split this into rows. I'll click OK, and we now have a row for each of those items. Again,
this is a really useful feature. Splitting by columns is useful, but often we do want to split
by rows. Why is this advanced? I've got no idea. It's the kind of thing that we want to do all the
time. For our last example, we're going to look at the advanced options when we extract text based
on delimiters. In our example file, I'm going to click on sizes and go to extract. And the advanced
options are in these last three options of before delimiter, after delimiter, and between delimiters.
And the options in here are very similar between those three items. Let's select the first item
of text before delimiter. We can enter our delimiter. I'll enter a comma. When we click OK,
that's simply going to extract the text before the first comma. But what's inside those advanced
options? I'll click on the gear icon. Let's come to advanced options. And in here, once again,
we have features which are not advanced. They're really useful features. So do we want to start
from the beginning or the end to determine how we split that text string? We also get to say
how many items we want to skip over. Currently, it's zero, which means it will split at the first
delimiter. If we change that to one and click OK, it will then split at the second delimiter.
So once again, in those advanced options, we have features which aren't advanced. They're just
really useful. And that's it. That's five areas of Power Query which contain advanced features
that aren't advanced. They're the things that we need to do every day, but they've been hidden
away. Have I missed any? If so, let me know in the comments. Thanks for watching. I'll catch you next
time.