Power Query: More Haste Less Steps Part 2
27 April 2022
Welcome to our Power Query blog. This week I look again at a query with too many steps.
Last time, I looked at a Dates query:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/282/image1.png/e774d10cbbb9450fc45efbe51abdf434.jpg)
I deliberately went the long way round to create this query! Ignoring the first three [3] steps, it has taken me 12 steps to achieve my goal. This time I will look at how I could have achieved the same result with less steps, whilst still using the User Interface (UI).
The first task was to create a Month Name column with a short month name format. Last time, this took six [6] steps. One of the reasons for this is that I used the Transform tab options, which meant I had to duplicate columns to keep my original. Many functions exist on the Transform tab and the ‘Add Column’ tab for precisely this reason. Instead of duplicating a column like I did last time,
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/282/image2.png/f32e5a15e2cf9c3e4d2d058458ce054d.jpg)
I can go to the ‘Add Column’ tab, and add a column from the ‘Dates’ section:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/282/image3.png/f1140ff857fc3b6f5f97a6a24f4a6fc7.jpg)
I can then add the Month Name column in one step.
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/282/image4.png/72aa864d2854c6fefb1083fba0ab5792.jpg)
This replaces the two [2] steps I took to achieve this last time. The next step is to change Month Name to show the first three [3] characters of the month. Last time, I used ‘Split Column’ on the Transform tab to split the column ‘By Positions’, creating a ‘Split Column by Position’ step:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/282/image5.png/36776d1da4d05b45bb5a5d09375f407c.jpg)
This automatically generated a ‘Changed Type1’ step. I then had to delete the unwanted column, creating a ‘Removed Column’ step and rename the one I wanted to keep to ‘month’, creating a ‘Renamed Column1’ step:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/282/image6.png/23912d3b1671861e02bebcd5183f1607.jpg)
Would it surprise you to learn that I could create a column containing the short name in one step? This time, the Transform tab is the most appropriate:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/282/image7.png/6f49c288a0d88a66b427eaf4ece923d6.jpg)
Instead of splitting the column, I can simply transform this column using ‘Extract First Characters’:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/282/image8.png/b9ee28d90e6b5bc92ea4aeafdad51628.jpg)
This gives me the new format for Month Name in one step:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/282/image9.png/0485ccbc83bdeec1d741bad442a1ea5f.jpg)
Next time, I’ll look at how I can improve the functionality used to create a Quarter column in my required format.
Come back next time for more ways to use Power Query!