Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

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-msft's avatar
    v-lili6-msft
    Community 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

    • Anonymous's avatar
      Anonymous
      Not 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]))

    • ianjablonski's avatar
      ianjablonski
      New 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

    • shaikarshad29's avatar
      shaikarshad29
      Frequent 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? 

       
    • Anonymous's avatar
      Anonymous
      Not 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_Deckler's avatar
        Greg_Deckler
        Community 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.