Skip to main content

Posts

Showing posts with the label split

Power Query - Inserting blank rows at specific points

A recent addition to the 'split by delimiter' options allows a column to be split to rows as opposed to columns. This has a number of benefits but it can also be used to insert blank rows into a dataset. Update - to do this with multiple columns there are some additional steps, I've covered these at the bottom of this post. For example, if we had a list of colours and we wanted to add 2 blank rows between each change of colour Can be transformed to become… This is how its done. First, load the data to Power Query. For this example I've used the 'enter data' function to directly paste it into the data model. You can use the 'get and transform function in Excel to load a CSV or Excel file as required. Then, add an index from 0 and change the column name to 'Primary' Next we'll add another index from 1 and change the column name to 'Secondary' Once these are added, we'll use the 'Merge' function to merge the table with itself usi...