Forum Discussion

ghutchins's avatar
ghutchins
Icon for Helper II rankHelper II
3 years ago
Solved

Combine Text in a Column to a Row

In a table in Power BI I have 2 columns 'Action' and 'UserName'   For each 'Action'  there may be one, two, ... n 'Usernames' associated to that 'Action' in successive rows.  I would like to create a measure/column that lists the 'Action' one time and this new measure/column would contain all the usernames.  Is this even possible?  I have no option to change the way the data source.

What I have now (Program A not the only  Action)

ActionUsername
Develop and Roll out Program ABob
Develop and Roll out Program ATony
Develop and Roll out Program AWendy

 

What I wanna get to

ActionUsername
Develop and Roll out Program ABob, Tony, Wendy
Develop and Roll out Program BRalph, Chuck, Todd
Develop and Roll out Program CGweneth, Hallie, Vanna

 

Column = CONCATENATEX(TableName,TableName[UserName],", ") -->  puts all 'Usernames' in the table in each 'Action'
Measure = CONCATENATEX(TableName,TableName[UserName],", ") -->  puts all 'Usernames' in the table in Total section
 
Feels like i am so close yet so far away...

  • HI ghutchins 

     

    Try your measure like this:

     

     

    Measure = 
    
    IF(
       HASONEVALUE(TableName[Action]),
       CONCATENATEX(TableName,TableName[UserName],", "),
       BLANK()
    )

     

     

    Best regards

    Michael

    -----------------------------------------------------

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

    @ me in replies or I'll lose your thread.

3 Replies

  • Mikelytics's avatar
    Mikelytics
    Icon for Resident Rockstar rankResident Rockstar

    HI ghutchins 

     

    Try your measure like this:

     

     

    Measure = 
    
    IF(
       HASONEVALUE(TableName[Action]),
       CONCATENATEX(TableName,TableName[UserName],", "),
       BLANK()
    )

     

     

    Best regards

    Michael

    -----------------------------------------------------

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

    @ me in replies or I'll lose your thread.