Forum Discussion
Anonymous
4 years agoNot applicable
Return a concatenated string value based on calculation
Greetings everyone! I need help with the following moment: There are 2 columns: 1) Say the first column is a name of product 2) Second column is a part that belongs to a...
- 4 years ago
Anonymous
Please try= VAR CurrentProject = SELECTEDVALUE ( TableName[Name] ) VAR CurrentPartTable = CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[Part #] ) ) RETURN IF ( COUNTROWS ( CurrentPartTable ) = 1, CurrentProject, CONCATENATEX ( CurrentPartTable, TableName[Name], ", ", TableName[Name], ASC ) )
Anonymous
4 years agoNot applicable
It return the list of every occurence now, but that's a good way to start?
tamerj1
Community Champion
4 years agoAnonymous
Didn't know they are repeated. Please use
=
VAR CurrentProject =
SELECTEDVALUE ( TableName[Name] )
VAR CurrentPartTable =
CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[Part #] ) )
VAR ProjectNames =
DISTINCT ( SELECTCOLUMNS ( CurrentPartTable, "@Name", TableName[Name] ) )
RETURN
IF (
COUNTROWS ( ProjectNames ) = 1,
CurrentProject,
CONCATENATEX ( ProjectNames, [@Name], ", ", [@Name], ASC )
)