Forum Discussion

FabianoJohann's avatar
FabianoJohann
Regular Visitor
3 years ago
Solved

Repeat column and multiply

by power query, I'll give an example of the tables:

Table 1

Name

Adam

Frank

Thomas



I need an M formula to add a second column that repeats all the names for each name in column 1 except itself, so it looks like this:

Name

Partner

Adam

Frank

Adam

Thomas

Frank

Adam

Frank

Thomas

Thomas

Adam

Thomas

Frank

  • Add a custom column:

    List.RemoveItems(thePreviousStepName[Name], {[Name]})

    then Expand the column 'To Rows'

1 Reply

  • HotChilli's avatar
    HotChilli
    Community Champion

    Add a custom column:

    List.RemoveItems(thePreviousStepName[Name], {[Name]})

    then Expand the column 'To Rows'