Forum Discussion
CONCATENATEX without duplication (DAX)
- 5 years ago
Saxon10 , Try new column like
Supplier code = CONCATENATEX(Summarize(FILTER(DATA,DATA[ITEM]=EARLIER(DATA[ITEM])),DATA[Supplier Code]),[Supplier Code],",")
- 5 years ago
Try:
Supplier code = VAR _table = CALCULATETABLE ( VALUES ( DATA[Supplier Code] ), FILTER ( ALL ( DATA ), DATA[ITEM] = EARLIER ( REPORT[ITEM] ) ) ) RETURN CONCATENATEX ( _table, DATA[Supplier Code], "," )
I am trying to copy and paste the tables(Data&Report) here but I am receving the following error can you please advise how can I rectify the problem?
Herewith attached the Power Bi file for your reference https://www.dropbox.com/s/1qashz0f8gftip0/CONCORNATEX.pbix?dl=0
- PaulDBrown5 years agoCommunity Champion
Saxon10
1) as a calculated column in the Data tableSupplier code Concatenate = VAR _table = CALCULATETABLE ( VALUES ( DATA[Supplier Code] ), FILTER ( ALL ( DATA ), DATA[ITEM] = EARLIER ( DATA[ITEM] ) ) ) RETURN CONCATENATEX ( _table, DATA[Supplier Code], "," )you get:
2) as a measure:
Supplier code Concatenate (as a measure) = CONCATENATEX ( VALUES(DATA[Supplier Code]), DATA[Supplier Code], "," )- Saxon105 years agoPost Prodigy
Thanks for your quick reply again.
I try your another soultion but still I am not getting NA agaist item 1066 and 2000?
If item not available in data table then return “NA” in report table according to the item.
please advise.
- PaulDBrown5 years agoCommunity Champion
Try:
1) as a calculated column in the DATA table:
Supplier code Concatenate = VAR _table = CALCULATETABLE ( VALUES ( DATA[Supplier Code] ), FILTER ( ALL ( DATA ), DATA[ITEM] = EARLIER ( DATA[ITEM] ) ) ) VAR _Concat = CONCATENATEX ( _table, DATA[Supplier Code], "," ) RETURN IF(DATA[Supplier Code] = "", "NA", _Concat)2) as a measure
Supplier code Concatenate (as a measure) = CONCATENATEX ( VALUES ( DATA[Supplier Code] ), IF ( MAX ( DATA[Supplier Code] ) = "", "NA", DATA[Supplier Code] ), "," )