Forum Discussion
juhoneyighot
1 year agoHelper III
Concatenate rows from another table
Hello!
I need help in what Dax formula to use.
I have this table _Facts
| Company | LookupAccount | GL |
| BBG | BBG_84 Lumber | 200100 |
| BBG | BBG_84 Lumber | 506510 |
| BBG | BBG_Budz | 220311 |
| BBG | BBG_Budz | 20100 |
| LBP | LBP_Buckhanon | 506510 |
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 | __AccountVendorKnownAsKey | GL.List |
| BBG | BBG_84 Lumber | 20100,506510 |
| BBG | BBG_Budz | 220311,20100 |
| LBP | LBP_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
- rajendraongole1Super User
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.
- juhoneyighotHelper III
- danextianSuper User
Hi juhoneyighot
Try this:
concatenated = CONCATENATEX ( FILTER ( ALL ( FactTable ), FactTable[LookupAccount] = SELECTEDVALUE ( FactTable[LookupAccount] ) ), [GL], ", " ) - Bibiano_GeraldoSuper User
Hi juhoneyighot ,
Try the bellow DAX measure:
GL.List = CONCATENATEX( FILTER( _Facts, _Facts[Company] = Vendor3[Company] && _Facts[LookupAccount] = Vendor3[__AccountVendorKnownAsKey] ), _Facts[GL], "," )