Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
InsightSeeker
Helper III
Helper III

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_Date  and

- Find the second Leg_Num and find the corresponding From_Date  and

- Find the third Leg_Num and find the corresponding From_Date  and

- Find the fourth Leg_Num and find the corresponding From_Date and

Continue this process...

 

Use "|" between From_Date in the final result.

 

Data 

 

unique_id

Leg_Num

From_Date

10141372

1

10-Sep-24

10141372

2

11-Sep-24

10141372

3

9-Oct-24

10141372

4

9-Oct-24

10141376

1

19-Aug-24

10141376

2

22-Aug-24

10141438

1

24-Oct-24

10141438

2

24-Oct-24

10141438

3

21-Nov-24

10141438

4

21-Nov-24

10141456

1

13-Sep-24

10141456

2

24-Sep-24

10141456

3

24-Sep-24

10141465

1

14-Sep-24

10141465

2

14-Sep-24

10141465

3

24-Sep-24

10141465

4

24-Sep-24

 

Result

 

unique_idLeg_NumFrom_DateColumn2
10141372110-Sep-2410-Sep-24 | 11-Sep-24 | 09-Oct-24 | 09-Oct-24
10141372211-Sep-2410-Sep-24 | 11-Sep-24 | 09-Oct-24 | 09-Oct-24
10141372309-Oct-2410-Sep-24 | 11-Sep-24 | 09-Oct-24 | 09-Oct-24
10141372409-Oct-2410-Sep-24 | 11-Sep-24 | 09-Oct-24 | 09-Oct-24
10141376119-Aug-2419-Aug-24 | 22-Aug-24
10141376222-Aug-2419-Aug-24 | 22-Aug-24
10141438124-Oct-2424-Oct-24 | 24-Oct-24 | 21-Nov-24 | 21-Nov-24
10141438224-Oct-2424-Oct-24 | 24-Oct-24 | 21-Nov-24 | 21-Nov-24
10141438321-Nov-2424-Oct-24 | 24-Oct-24 | 21-Nov-24 | 21-Nov-24
10141438421-Nov-2424-Oct-24 | 24-Oct-24 | 21-Nov-24 | 21-Nov-24
10141456113-Sep-2413-Sep-24 | 24-Sep-24 | 24-Sep-24
10141456224-Sep-2413-Sep-24 | 24-Sep-24 | 24-Sep-24
10141456324-Sep-2413-Sep-24 | 24-Sep-24 | 24-Sep-24
10141465114-Sep-2414-Sep-24 | 14-Sep-24 | 24-Sep-24 | 24-Sep-24
10141465214-Sep-2414-Sep-24 | 14-Sep-24 | 24-Sep-24 | 24-Sep-24
10141465324-Sep-2414-Sep-24 | 14-Sep-24 | 24-Sep-24 | 24-Sep-24
10141465424-Sep-2414-Sep-24 | 14-Sep-24 | 24-Sep-24 | 24-Sep-24
2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for adding a new column.

 

Jihwan_Kim_0-1724864098589.png

 

 

expected result CC =
CONCATENATEX (
    FILTER ( data, data[unique_id] = EARLIER ( data[unique_id] ) ),
    data[From_Date],
    " | ",
    data[Leg_Num]
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

_AAndrade
Super User
Super User

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:

_AAndrade_0-1724864685915.png

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

2 REPLIES 2
_AAndrade
Super User
Super User

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:

_AAndrade_0-1724864685915.png

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for adding a new column.

 

Jihwan_Kim_0-1724864098589.png

 

 

expected result CC =
CONCATENATEX (
    FILTER ( data, data[unique_id] = EARLIER ( data[unique_id] ) ),
    data[From_Date],
    " | ",
    data[Leg_Num]
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors