Forum Discussion

MP_123's avatar
MP_123
Icon for Microsoft Employee rankMicrosoft Employee
10 years ago

merge two strings and sort alphabetically

hi

i want to combine two strings but i want the combining will be alphabetically

i know the contanatex function but i can't control the sort with this function

do you have an idea?

 

thanks!

7 Replies

  • Could you please provide a little more information? Perhaps some example of your data in your 2 columns and specify which value you want your new column to sort by - where is it you want the sorting?

    • MP_123's avatar
      MP_123
      Icon for Microsoft Employee rankMicrosoft Employee

      sdjensen,i have slicer with products for example

      and i want to create new column/measure that combine the selected items on the slicer

      for example

      bread

      milk

      jam

      chocolate

      so if i selected the two , the new column will be chocolate,milk

      and if i don't select nothing it will be bread, chocolate, jam, milk

       

      thanks!

       

      • sdjensen's avatar
        sdjensen
        Icon for Solution Sage rankSolution Sage

        MP_123 You could try this formula as a measure...

         

        string = CONCATENATEX( Table1; Table1[Product]; ", "; Table1[Product])