Forum Discussion
bbelman
5 years agoNew Member
In DAX formula, Conditionally Concatenate value from another table
I am trying to use a DAX forumla to create a new table that requires me to reference existing data (which will be the rows in the table) and I also need to reference other existing data in order to c...
- 5 years ago
@bbelman You can create a new table with the following measure:
Table 2 = VAR __table = ADDCOLUMNS ( 'Primary Table', "combine", IF ( RELATED ( 'Secondary Table'[rate] ) <> 1, 'Primary Table'[summary] & " - " & RELATED ( 'Secondary Table'[descripton] ), 'Primary Table'[summary] ) ) RETURN SELECTCOLUMNS ( __table, "id", [id], "summary", [combine] )
v-jingzhang
Community Support
5 years ago@bbelman You can create a new table with the following measure:
Table 2 =
VAR __table =
ADDCOLUMNS (
'Primary Table',
"combine",
IF (
RELATED ( 'Secondary Table'[rate] ) <> 1,
'Primary Table'[summary] & " - " & RELATED ( 'Secondary Table'[descripton] ),
'Primary Table'[summary]
)
)
RETURN
SELECTCOLUMNS ( __table, "id", [id], "summary", [combine] )
- bbelman5 years agoNew Member
Worked perfectly. Thank you! I expect the other posted solution provided will also work but performing the action in a measure as opposed to a calcualted column provides better proformance by keeping the dataset lean.