Forum Discussion

karinafreitass's avatar
karinafreitass
Helper III
5 years ago
Solved

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:

 

Thanks,

 

Karina

  • Hi, karinafreitass 

     

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

    Table:

     

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

     

    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:

     

    Best Regards

    Allan

     

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

2 Replies

  • v-alq-msft's avatar
    v-alq-msft
    Community Support

    Hi, karinafreitass 

     

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

    Table:

     

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

     

    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:

     

    Best Regards

    Allan

     

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