Pergunta

I am mew to DAX. How can I concatenate three different columns say First_Name, Middle_Name and Last_Name to a single column with a space in between using CONCATENATE function in DAX. At present I could concatenate only two columns.

=CONCATENATE(FIRST_NAME],CONCATENATE(" ",[LAST_NAME]))

If any other function is there please do let me know that also. My aim is to concatenate 1st Name, 2nd Name and 3rd Name into a single column in SSAS Tabular Model

Please help me. Thanks in Advance

Foi útil?

Solução

If the columns are already text, you can use th & operator, i. e. use

[FIRST_NAME] & " " & [LAST_NAME]

You can find the documentation of concatenate - including the fact that it only accepts two arguments - at http://technet.microsoft.com/en-us/library/ee634811.aspx.

Outras dicas

For anyone coming back to this, particularly if you have more than two variables to concatenate, consider using COMBINEVALUES():

=COMBINEVALUES(<delimiter>, <expression>, <expression>[, <expression>]…)

For the posted question, this would look like:

=COMBINEVALUES(" ", [FIRST NAME], [LAST NAME])

And can be expanded to include additional values after [LAST NAME].

You can use nested CONCATENATE functions with the & to append your spaces. Following your example:

=CONCATENATE([FIRST NAME]&" ", CONCATENATE([MIDDLE NAME]&" ", [LAST NAME]))
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top