How to Split a column into rows | Excel Power Query 02

Do you want to split cells into sep­a­rate rows and repeat val­ues from oth­er columns? I will show you how.

How to Split col­umn into rows | Excel Pow­er Query 02

In our exam­ple, we have names of pub­lish­ers and series. In short, we want to go from this table (Fig. 1):

to this table (Fig. 2):

The task is real­ly sim­ple when using Pow­er Query. We need to go to the Data tab and choose the From Table/Range com­mand (Fig. 3). 

It allows us to import our table to Pow­er Query. In our exam­ple, we have two columns from which we want to select the Series col­umn and split it into rows. When this col­umn is select­ed, we need to go to the Home tab and find the Split Col­umn com­mand, then choose the By Delim­iter option (Fig. 4). 

Pow­er Query will choose a space as the delim­iter for us. How­ev­er, in our case the delim­iter is a semi­colon and a space. It means that we need to select the Cus­tom option and write the semi­colon and a space in the prop­er bar (Fig. 5). 

Then, we should select the Each occur­rence of the delim­iter radio but­ton. Now, let’s open Advanced options. We can see that columns are select­ed as the default option. Let’s change it into rows. Now, we can press OK (Fig.6) .

And we have the result. Now, we can go to the Home tab, then to the Close and Load com­mand and choose the Close and Load to option. This way, we can load impor­tant data from Pow­er Query to Excel (Fig. 7). 

In Excel, we are choos­ing the Table radio but­ton, then the Exist­ing work­sheet and then we have to select the tar­get cell, which in our case is D1. Let’s close it with OK (Fig 8).

As we can see, we went from the table on the left to the table on the right (Fig. 9). 

https://www.youtube.com/watch?v=OjeedTaBReg

Running Total in Pivot Table

Some­times, you need to cre­ate a run­ning total in piv­ot tables. How to do it properly?

Run­ning Total in Piv­ot Table

Let’s start with cre­at­ing a piv­ot table. Select one cell from our data and go to the Insert tab and select the Piv­ot Table com­mand. A Piv­ot table from table or range win­dow will appear, where we have our range. We need to select the Exist­ing work­sheet radio but­ton and write the loca­tion, which, in our case, will be cell F1. Let’s click the OK but­ton (Fig. 1).

Creating a pivot table
Fig. 1 Cre­at­ing a piv­ot table

And there we have it. In our piv­ot table we need to drag the Date to the Rows labels. 

Dragging the date
Fig. 2 Drag­ging the date

Now, depend­ing on the Excel ver­sion, we have an option of Group by dates. I’m going to group our date by months and years (Fig. 3).

Grouping
Fig. 3 Grouping 

We have our table. Now, I want to add Income so let’s press the Income check­box (Fig. 4). 

 Income checkbox
Fig. 4 Income checkbox

Now, I want to have the income and the run­ning total for the income, so let’s drag the Income two times to the Val­ues area. We can see that we have Sum of Income and Sum of Income 2, where we actu­al­ly want to have our run­ning total (Fig. 5). 

Income and Income 2
Fig. 5 Income and Income 2

Let’s right click any val­ue from Income 2, then select the Show Val­ues as and then the Run­ning Total In option (Fig. 6). 

Selecting the Running Total option
Fig. 6 Select­ing the Run­ning Total option

Now, we have to decide whether we want to base our run­ning total on Date or Years Field. Let’s take Date (Fig. 7).

 Date Field
Fig. 7 Date Field

Now, we can see that in the Income 2 col­umn we have big­ger num­bers. Let’s for­mat them by press­ing any cell in the col­umn and choos­ing the Num­ber For­mat option (Fig. 8). 

Number Format option
Fig. 8 Num­ber For­mat option

In the For­mat Cell win­dow, let’s choose the Cur­ren­cy cat­e­go­ry, in Dec­i­mal places let’s write 0 and press the OK but­ton. Let’s do the same in the Sum of Income col­umn (Fig. 9). 

 Format cell window
Fig. 9 For­mat cell window

Now, we can see that we are work­ing with mon­ey. In each month we have big­ger and big­ger num­bers which means that we have the run­ning total in this col­umn. We can change the name of Sum of Income 2 into Run­ning Total. Since we are using the Date Field as our ref­er­ence point, we have the run­ning total in 2020. In 2021 Excel counts from the start, which means that we have the run­ning total only for 2021. The same is with 2022. If we change the Date field into the Years field in the Show Val­ues as (Run­ning Total) win­dow, we will have the same val­ue in the first year and in the Sum of Income col­umn (Fig. 10).

Years
Fig. 10 Years

How­ev­er, in the next year, we have the the sum from Jan­u­ary 2021 and Jan­u­ary 2020. In Feb­ru­ary, we have the sum from Feb­ru­ary 2021 and 2020. In 2022, we have sums from three Feb­ru­ar­ies (Fig. 11).

Sums from three Ferbuaries
Fig. 11 Sums from three Ferbuaries

Let’s drag Man­ag­er into the columns head­er (Fig. 12).

Dragging Manager into headers
Fig. 12 Drag­ging Man­ag­er into headers

By doing so, we can show val­ue from the Man­ager’s per­spec­tive, which means a hor­i­zon­tal view. 

Horizontal view
Fig. 13 Hor­i­zon­tal view

How­ev­er, this type of data isn’t a prop­er one to show it this way, so let’s get back by press­ing Ctrl + Z two times and see that we can also cre­ate a per­cent run­ning total by going to the % Run­ning Total In option and choose the Date Field (Fig. 14). 

Percentage Running Total
Fig. 14 Per­cent­age Run­ning Total

Now, we can see the val­ues as per­cent­age (Fig. 15). 

Results
Fig. 15 Results

https://www.youtube.com/watch?v=ikou6toX11g