Forum Discussion

juhoneyighot's avatar
juhoneyighot
Helper III
1 year ago
Solved

Concatenate rows from another table

Hello!

I need help in what Dax formula to use.

I have this table _Facts

CompanyLookupAccountGL
BBGBBG_84 Lumber 200100
BBGBBG_84 Lumber506510 
BBGBBG_Budz220311
BBGBBG_Budz20100
LBPLBP_Buckhanon506510

Then from Vendor3 table, I will create a measure(GL.List) to concatenate the lists of the GL for a certain company and the lookup account from _Facts table. This would be its result.

Company__AccountVendorKnownAsKeyGL.List
BBGBBG_84 Lumber20100,506510
BBGBBG_Budz220311,20100
LBPLBP_Buckhanon

506510

I already have a relationship between the _Facts Table and the Vendor3 table.

Hope you could help me on this.

 

Thank you.

  • Hi juhoneyighot - you can use DAX with the CONCATENATEX function

     

    create dax measure to your model as below:

    GL.List =
    CONCATENATEX(
        FILTER(
            _Factt,
            _Factt[Company] = SELECTEDVALUE(Vendor[Company]) &&
            _Factt[LookupAccount] = SELECTEDVALUE(Vendor[__AccountVendorKnownAsKey])
        ),
        _Factt[GL],
        ", "
    )

     

     

     

     

    Hope this helps.

     

     

     

4 Replies

  • Hi juhoneyighot - you can use DAX with the CONCATENATEX function

     

    create dax measure to your model as below:

    GL.List =
    CONCATENATEX(
        FILTER(
            _Factt,
            _Factt[Company] = SELECTEDVALUE(Vendor[Company]) &&
            _Factt[LookupAccount] = SELECTEDVALUE(Vendor[__AccountVendorKnownAsKey])
        ),
        _Factt[GL],
        ", "
    )

     

     

     

     

    Hope this helps.

     

     

     

  • Hi juhoneyighot 

     

    Try this:

    concatenated = 
    CONCATENATEX (
        FILTER (
            ALL ( FactTable ),
            FactTable[LookupAccount] = SELECTEDVALUE ( FactTable[LookupAccount] )
        ),
        [GL],
        ", "
    )
    

     

  • Hi juhoneyighot ,

    Try the bellow DAX measure:

    GL.List = 
    CONCATENATEX(
        FILTER(
            _Facts,
            _Facts[Company] = Vendor3[Company] &&
            _Facts[LookupAccount] = Vendor3[__AccountVendorKnownAsKey]
        ),
        _Facts[GL],
        ","
    )