Forum Discussion

dw700d's avatar
dw700d
Post Patron
4 years ago
Solved

combining two rows into one

I have two columns. Column 1 contains the names of account holders. Column 2 contains account codes, I would like to create a measure that determines if an account holder has multiple account codes  and then combines those occurrences into one row.

 

Current output

 

Account Holder

Account Code

Tim

ABC

Tim

DEF

John

GHI

John

JKL

Bill

MNO

 

Desired output

 

Account Holder

Account Code

Tim

ABC+DEF

John

GHI+JKL

Bill

MNO

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi dw700d ,

     

    You could create a calculated column.

    Column = CONCATENATEX(FILTER('Table',[Account Holder]=EARLIER('Table'[Account Holder])),'Table'[Account Code],"+")

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • Hi dw700d

     

    Try this

    Answer =

    CONCATENATEX(Yourtable,Yourtable[AccountCode],"+")
     
    Please click the thumbs up and accept as solutions buttons.
    If you need add extra complexity to the problem then please accept this solution and raise new tickets.
    You will get a response and each solver get the kudos they deserve. Thanks. ğŸ˜€
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi dw700d ,

     

    You could create a calculated column.

    Column = CONCATENATEX(FILTER('Table',[Account Holder]=EARLIER('Table'[Account Holder])),'Table'[Account Code],"+")

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.