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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Uzi2019
Super User
Super User

how to shift row values to next row

Hi Community,

I have two column one is date another is values. I have tried a lot many approaches but not getting any complete result. 

So basicaly, value should be shifted to next row as per date and if same date is repeated so same values should be there. If i am not clear so below is the expected ouput.

I tired this below DAX not getting 100% result:

output = CALCULATE(MAX(tbl[Values]),FILTER(tbl,tbl[Index]=EARLIER(tbl[Index])-1))
 
test.PNG

 

Input is like below: 

Date    Values
1/1/2020    138
1/1/2020    124
1/2/2020    120
1/3/2020    80
1/3/2020    100
1/4/2020    90
1/5/2020    110
 
Expected Output:
 
Date        Values    Output
1/1/2020    138    138
1/1/2020    124    124
1/2/2020    120    124
1/3/2020    80    80
1/3/2020    100    100
1/4/2020    90    100
1/5/2020    110    90

TIA!

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
1 ACCEPTED SOLUTION

@Uzi2019 ,

First, create Index column from Query editor and then try below DAX column:

Output =
VAR A = MIN('TABLE'[Date])
RETURN IF('TABLE'[Date]=A,('TABLE'[Values]),LOOKUPVALUE('TABLE'[Values],'TABLE'[Index],'TABLE'[Index]-1))
 
1.PNG
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

3 REPLIES 3
Uzi2019
Super User
Super User

Can anybody help me out in this. It's little urgent.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

@Uzi2019 ,

First, create Index column from Query editor and then try below DAX column:

Output =
VAR A = MIN('TABLE'[Date])
RETURN IF('TABLE'[Date]=A,('TABLE'[Values]),LOOKUPVALUE('TABLE'[Values],'TABLE'[Index],'TABLE'[Index]-1))
 
1.PNG
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Tahreem24 

 

Thank you for your reply.. solution is working perfectly for me.. thank you for your time.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors