Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
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).
Kindly let me know if there is any formula or DAX to do this
Solved! Go to Solution.
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
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
In addition, you can refer the following links to get it.
Power BI: Get value from next row
Fast and easy way to reference previous or next rows in Power Query or Power BI
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
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
Best Regards
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
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
Best Regards
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
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
In addition, you can refer the following links to get it.
Power BI: Get value from next row
Fast and easy way to reference previous or next rows in Power Query or Power BI
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
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
111 | |
104 | |
103 | |
87 | |
61 |
User | Count |
---|---|
164 | |
132 | |
131 | |
95 | |
86 |