Forum Discussion

wilson_smyth's avatar
wilson_smyth
Post Patron
7 years ago
Solved

concatenating values from multiple rows

I have multiple projects and multiple users. There is a fact table linking projects to users. I need to create a single column that contains all user names associated with a project. Im unsure ho...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi wilson_smyth ,

     

    follow these steps:

    I merged all the queries like this:

     

    Created a Calculated column

    Column = CONCATENATEX(FILTER(SUMMARIZE(DIM,DIM[DIM Project.Project Name],DIM[Username]),[DIM Project.Project Name]=EARLIER(
    DIM[DIM Project.Project Name])),[Username],",")

    Than in a table column add the fields to get the output like this:

     

     

     

    Let me know if this works for you.

     

    Thanks,

    Tejaswi

     

  • Zubair_Muhammad's avatar
    7 years ago

    wilson_smyth 

     

    Another way could be to use CROSS FILTER

    This formula works as both Column and a MEASURE

     

    Column/Measure =
    CONCATENATEX (
        CALCULATETABLE (
            VALUES ( 'dim user'[username] ),
            CROSSFILTER ( 'fact table'[userid], 'dim user'[userid], BOTH )
        ),
        [username],
        ", "
    )