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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Refer to previous/next row in a calculated column

Hi All,

 

I am trying to create a calculated column which lists the value of the previous row of another column.

 

refer pbi.png

 

Any ideas on how to do this?

 

1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@Anonymous ,

 

  1. Step 1: Go to Power Query Editor --> Add Column Option --> CLick on "Index Column" --> Apply and CLose.
  2. Create Measure = CALCULATE(VALUES('Table'[Exchange]),'Table'[Index]-1)

Capture.JPG

Don't forget to hit Thumbs up and accept this as a solution if you find it helpful! 

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

4 REPLIES 4
Tahreem24
Super User
Super User

@Anonymous ,

 

  1. Step 1: Go to Power Query Editor --> Add Column Option --> CLick on "Index Column" --> Apply and CLose.
  2. Create Measure = CALCULATE(VALUES('Table'[Exchange]),'Table'[Index]-1)

Capture.JPG

Don't forget to hit Thumbs up and accept this as a solution if you find it helpful! 

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
Anonymous
Not applicable

 Thank you for this. I created the index column, but want a calculated instead of the measure you described. I tried using the same equation in calculated column but it did not work. Any tips?

@Anonymous ,

 

Create column like below:

Column = CALCULATE(MAX('Table'[Exchange]),ALL('Table'),'Table'[Date]<EARLIER('Table'[Date]))
 
Don't forget to hit Thumbs up and accept this as a solution if you find it helpful! 
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
Anonymous
Not applicable

Hi @Tahreem24 how do I do this if I want it the other way around? 

StartOutput End
22/03/202028/03/2020
29/03/202030/03/2020
31/03/202004/04/2020
05/04/202011/04/2020
12/04/202013/04/2020
14/04/2020 

Thank you

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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