Forum Discussion
Saxon10
5 years agoPost Prodigy
CONCATENATEX without duplication (DAX)
I have a two tables are data and report. Data: In Data table I have two columns are Item and supplier code, The item column and supplier code contain/stored as a number and text, both c...
- 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], "," )
Saxon10
5 years agoPost Prodigy
Herewith attached the Power Bi file for your reference https://www.dropbox.com/s/1qashz0f8gftip0/CONCORNATEX.pbix?dl=0
PaulDBrown
5 years agoCommunity Champion
Saxon10
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] ) )
)
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] ), "," )