Please note javascript is required for full website functionality.

Blog

Power Query: Selective Staffing Part 6

1 December 2021

Welcome to our Power Query blog. This week I look at another method to solve my second inclusion example.

In Power Query: Selective Staffing Part 3, I had a table of quote data for each of my salespeople, and a list of salespeople that I wished to view quote details for:

I used M List() functionality to achieve the result:

There is often more than one method to achieve the same results, and this time, I will look at another approach I could have used for this example.

Instead of using list functionality, I could join the tables. To show how this would work, I start again with a copy of the original data. In this example, the Excel Tables are called Staff_Quotes_Join and Quote_Selection_Join.

I import both Tables using ‘From Table/Range’ in the ‘Get & Transform’ section of the Data tab. This time, I leave Quote_Selection_Join as a table:

Starting from Staff_Quotes_Join, I can choose to ‘Merge Queries’ from the Home tab.

In the dialog, I choose Quote_Selection_Join:

If I choose to link Salesperson to Include, I could use a ‘Left Outer’ join to select all the matching rows.

This matches four rows on the first table, but it would still leave me with more work to do as I would still have all the rows from the first table:

I could start from Quote_Selection_Join and perform a ‘Left Outer’ join from there, but that will not help me when I come to expand this example later. Alternatively, I could use a different type of join – an Inner Join:

I use the Inner Join:

Although it sounds similar, the results are not the same:

I don’t need to expand the new column, I can simply delete it, and I have all the data I need.

Next time I will look at how I can expand this to allow me to consider inclusion and exclusion in the same example.

Come back next time for more ways to use Power Query!

Newsletter