Forum Discussion

prvn's avatar
prvn
Frequent Visitor
4 years ago
Solved

Relationship for Comma seperated id column

I have 2 tables as shown below, master table has unique keys and used in other tables.  GroupQuestions table has a column ActivityIds, which are array of master key, i have transformed it into...
  • prvn's avatar
    prvn
    4 years ago

    I did not want to split into rows as i wanted to view the cell value with comma seperated items. But this made me think and i went with splitting the arrays to rows and then did a custom measure later where i concatenated everything back.
    This link helped me Solved: group by and then concateate comma separated - Microsoft Power BI Community

    The custom measure is like below

    Combined Ast = 
    VAR __rlvnttable =
        CALCULATETABLE (
            VALUES ( 'ToGroupAnwsers'[Document.Questions] ),
            'ToGroupAnwsers'[Document.Questions] <> BLANK ()
        )
    RETURN
        CONCATENATEX (
            __rlvnttable,
            'ToGroupAnwsers'[Document.Questions],
            ", ",
            'ToGroupAnwsers'[Document.Questions], ASC
        )

     

    Will keep in mind to post data in next post 🙂