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! Request 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
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