Forum Discussion
Concatenate Measure not Custom Column
I need to Concatenate Two text strings for a Matrix to simplify the view. We have a Data Cube that does not allow the addition of Tables or Custom Columns. DAX CONCATENATE is for a custom Column.
I cannot figure out how to do this wirth a Measure. I saw one solution but it basically grabs all data and it is not recommended due to the slowdown of the processing.
Any Ideas?
Thank you.
10 Replies
- v-lili6-msftCommunity Support
Hi@ Moscuba
You can try to this measure as below:
Measure 3 = CONCATENATE ( SELECTEDVALUE ( 'Table2'[PCATID] )&"_", SELECTEDVALUE ( 'Table2'[PCAT Name] ) )
Result:
Best Regards,
Lin
- AnonymousNot applicable
This is the perfect answer which I was looking for, Thanks lot for the help. Even on the microsoft own portal they mentioned the Dax function but the syntax is incorrect when we tried using text filed name which is not measures
https://docs.microsoft.com/en-us/dax/concatenate-function-dax
=CONCATENATE(Customer[LastName], CONCATENATE(", ", Customer[FirstName]))
- ianjablonskiNew Member
This is the same measure i was looking for except i would like to extend it by making it a count.
Said differently I would like the measure to return the count of "Measure 3", in your example, to be used in a Card .
Can this be done ?
Thansk You - shaikarshad29Frequent Visitor
Is it possible to include the final concatenated srting in table, without making use of original string columns inside table from where the final stringw as derived?
- Greg_DecklerCommunity Champion
You can use CONCATENATE in a measure. Sample data would help tremendously. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- AnonymousNot applicable
The Data is Text columns in this case. When I trierd CONCATENATE it did not work. It refused to use valid table and fields.
Here is the example I saw in the DAX Pages:
=CONCATENATE(Customer[LastName], CONCATENATE(", ", Customer[FirstName]))
PCATID PCAT Name
AAAA Sealant 1
AAAB Sealant 2
BBBA Adheasive1
BBBB Adheasive2
I'' like to join the two with a space or underscore in between like:
AAAA _Sealant1
No Number conversions needed.
- Greg_DecklerCommunity Champion
When working with measures, you need to do an aggregation on a column, like MAX:
Measure = MAX([PCATID]) & "_" & MAX([PCAT Name])
And I would use the & operator instead of CONCATENATE.