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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
pranays2
Frequent Visitor

Create a column to get values from other column but from 2nd row

Hi,

 

I want to create a new column (B) where the values should be from already existing column (A) but in the new column (B) i want the values to start from 2nd row of col (A).

 

 PBI Doubt.PNG

Kindly let me know if there is any formula or DAX to do this 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @pranays2 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Add one index column in Power Query Editor

yingyinr_2-1674199873298.png

2. Create a calculated column as below to get it

Column B = 
VAR _nextindex =
    CALCULATE (
        MIN ( 'Table'[Index] ),
        FILTER ( 'Table', 'Table'[Index] > EARLIER ( 'Table'[Index] ) )
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[Column A] ),
        FILTER ( 'Table', 'Table'[Index] = _nextindex )
    ) + 0

yingyinr_3-1674199942296.png

In addition, you can refer the following links to get it.

Power BI: Get value from next row

yingyinr_0-1674199363238.png

Fast and easy way to reference previous or next rows in Power Query or Power BI

yingyinr_1-1674199446803.png

If the above one can't help you, could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

Anonymous
Not applicable

Hi @pranays2 ,

I updated my sample pbix file(see the attachment) with creating a measure, please check if that is what you want.

Measure = 
VAR _selindex =
    SELECTEDVALUE ( 'Table'[Index] )
VAR _selcolumnA =
    SELECTEDVALUE ( 'Table'[Column A] )
VAR _nextindex =
    CALCULATE (
        MIN ( 'Table'[Index] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Index] > _selindex )
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[Column A] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Index] = _nextindex )
    ) + 0

yingyinr_0-1675132996722.png

Best Regards

View solution in original post

3 REPLIES 3
pranays2
Frequent Visitor

Thanks for the reply but the result value which i want is a measure so i'm not able to get it correctly using the above method can you let me know if there is a way to do this for measure

Anonymous
Not applicable

Hi @pranays2 ,

I updated my sample pbix file(see the attachment) with creating a measure, please check if that is what you want.

Measure = 
VAR _selindex =
    SELECTEDVALUE ( 'Table'[Index] )
VAR _selcolumnA =
    SELECTEDVALUE ( 'Table'[Column A] )
VAR _nextindex =
    CALCULATE (
        MIN ( 'Table'[Index] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Index] > _selindex )
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[Column A] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Index] = _nextindex )
    ) + 0

yingyinr_0-1675132996722.png

Best Regards

Anonymous
Not applicable

Hi @pranays2 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Add one index column in Power Query Editor

yingyinr_2-1674199873298.png

2. Create a calculated column as below to get it

Column B = 
VAR _nextindex =
    CALCULATE (
        MIN ( 'Table'[Index] ),
        FILTER ( 'Table', 'Table'[Index] > EARLIER ( 'Table'[Index] ) )
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[Column A] ),
        FILTER ( 'Table', 'Table'[Index] = _nextindex )
    ) + 0

yingyinr_3-1674199942296.png

In addition, you can refer the following links to get it.

Power BI: Get value from next row

yingyinr_0-1674199363238.png

Fast and easy way to reference previous or next rows in Power Query or Power BI

yingyinr_1-1674199446803.png

If the above one can't help you, could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.