cmcreynolds

Active Member
Joined
May 21, 2015
Messages
295
Hello everyone! I'm in a new position where I'm allowed to use PQ and PP again.

As always, I apologize if I am not asking this using the best terms:

I need to create a column within Power Query that indexes according to the column "SiteVisit".
The TL (Team Lead) is present in every site visit, but sometimes there are three persons, so a simple IF/Then statement won't work.

SiteVisit
Person
CustomColumn
9
TL-IP
1
9
DH
2
9
RR
3
10
TL-GQ
1
10
AR
2
10
TH
3
11
TL-MN
1
11
JJ
2
12
TL-PF
1
12
KK
2
13
TL-ST
1
13
BM
2

<tbody>
</tbody>

Glad to be back and have your help again.

Thanks for your patience, too!
Cliff
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Here is some 'M'.

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"SiteVisit"}, {{"Data", each _, type table}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Add Index", each Table.AddIndexColumn([Data], "Index", 1, 1)),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Data"}),
    #"Expanded Add Index" = Table.ExpandTableColumn(#"Removed Columns", "Add Index", {"Person", "Index"}, {"Person", "Index"})
in
    #"Expanded Add Index"
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top