Forum Discussion

InsightSeeker's avatar
InsightSeeker
Icon for Helper III rankHelper III
2 years ago
Solved

Need Assistance with DAX

Hello – I need assistance to join all the From_Dates and against each unique value in the assending order (Leg_Num)   For each unique_id: - Find the first Leg_Num and find the corresponding From_D...
  • Jihwan_Kim's avatar
    2 years ago

    Hi,

    Please check the below picture and the attached pbix file.

    It is for adding a new column.

     

     

     

    expected result CC =
    CONCATENATEX (
        FILTER ( data, data[unique_id] = EARLIER ( data[unique_id] ) ),
        data[From_Date],
        " | ",
        data[Leg_Num]
    )
    
  • _AAndrade's avatar
    2 years ago

    Hi InsightSeeker,

    Please try this dax formula as a calculated column:

    NewColumn = 
    VAR CurrentID = 'f_Data'[unique_id]
    RETURN
        CONCATENATEX(
            FILTER(
                'f_Data',
                'f_Data'[unique_id] = CurrentID
            ),
            FORMAT('f_Data'[From_Date], "dd-mmm-YY"),
            " | "
        )
    

    The final output would be this: