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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
karinafreitass
Helper III
Helper III

Join lines

Please guys,

can someone tell me how I would join 2 lines?

I would like to join the line a + b like exemplo above:

Screenshot (123).png

 

Thanks,

 

Karina

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @karinafreitass 

 

Based on your description, I created data to reproduce your scenario. Tjhe pbix file is attached in the end.

Table:

d1.png

 

You may create an index column in 'Query Editor' as below.

d2.png

 

Then you may create a calculated column or a measure as below.

Calculated Column:

Result Column = 
IF(
    NOT(ISBLANK([8/27/2020])),
    CONCATENATEX(
        FILTER(
            'Table',
            [Index]=EARLIER('Table'[Index])||
            [Index]=EARLIER('Table'[Index])+1
        ),
        [Column2],
        " "
    ),
    CONCATENATEX(
        FILTER(
            'Table',
            [Index]=EARLIER('Table'[Index])-1||
            [Index]=EARLIER('Table'[Index])
        ),
        [Column2],
        " "
    )
)

 

Measure:

Result Measure = 
IF(
    NOT(ISBLANK(SELECTEDVALUE('Table'[8/27/2020]))),
    CONCATENATEX(
        FILTER(
            ALL('Table'),
            [Index]=SELECTEDVALUE('Table'[Index])||
            [Index]=SELECTEDVALUE('Table'[Index])+1
        ),
        [Column2],
        " "
    ),
    CONCATENATEX(
        FILTER(
            ALL('Table'),
            [Index]=SELECTEDVALUE('Table'[Index])-1||
            [Index]=SELECTEDVALUE('Table'[Index])
        ),
        [Column2],
        " "
    )
)

 

Result:

d4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @karinafreitass 

 

Based on your description, I created data to reproduce your scenario. Tjhe pbix file is attached in the end.

Table:

d1.png

 

You may create an index column in 'Query Editor' as below.

d2.png

 

Then you may create a calculated column or a measure as below.

Calculated Column:

Result Column = 
IF(
    NOT(ISBLANK([8/27/2020])),
    CONCATENATEX(
        FILTER(
            'Table',
            [Index]=EARLIER('Table'[Index])||
            [Index]=EARLIER('Table'[Index])+1
        ),
        [Column2],
        " "
    ),
    CONCATENATEX(
        FILTER(
            'Table',
            [Index]=EARLIER('Table'[Index])-1||
            [Index]=EARLIER('Table'[Index])
        ),
        [Column2],
        " "
    )
)

 

Measure:

Result Measure = 
IF(
    NOT(ISBLANK(SELECTEDVALUE('Table'[8/27/2020]))),
    CONCATENATEX(
        FILTER(
            ALL('Table'),
            [Index]=SELECTEDVALUE('Table'[Index])||
            [Index]=SELECTEDVALUE('Table'[Index])+1
        ),
        [Column2],
        " "
    ),
    CONCATENATEX(
        FILTER(
            ALL('Table'),
            [Index]=SELECTEDVALUE('Table'[Index])-1||
            [Index]=SELECTEDVALUE('Table'[Index])
        ),
        [Column2],
        " "
    )
)

 

Result:

d4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-alq-msft 

This worked perfectly.

Thank you so much for the help

 

Karina

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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 Kudoed Authors