Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

DAX: FILTER and CONCATENATE UNIQUE values

 

I am trying to FILTER/LOOKUPVALUE and CONCATENATE the relevant UNIQUE values but right now, I am unable to get it to work. I can only do it without the values being UNIQUE.

My current DAX formula:
CONCATENATEX (
FILTER (
ALL ( Table2 ),
Table2[Column1] = Table1[Column1]
),
Table2[Column2],
", "
)

The output from here goes like:
Value1, Value2, Value2

My desired output is: (without any of the values being duplicated)
Value1, Value2
  • Anonymous , Assuming this is a new column, I tried the same on my data, a new column. without all

    Column = CONCATENATEX(summarize(FILTER(Sales,Sales[Item ID] = 'Item'[Item Id]), Sales[City Id]),[City Id], ",")

     

     

6 Replies

  • Anonymous , try like

     

    CONCATENATEX (
    summarize(FILTER (
    ALL ( Table2 ),
    Table2[Column1] = cvShipments[Column1]
    ),
    Table2[Column2]),
    ", "
    )

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak Hi there, thanks for commenting. I tried but the output that I've obtained is "," and ", ,"

      Seems like only commas are being concatenated here...

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        Anonymous , Assuming this is a new column, I tried the same on my data, a new column. without all

        Column = CONCATENATEX(summarize(FILTER(Sales,Sales[Item ID] = 'Item'[Item Id]), Sales[City Id]),[City Id], ",")

         

         

  • smpa01's avatar
    smpa01
    Icon for Community Champion rankCommunity Champion

    Anonymous  provide sample data and expected output to accelerate response