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
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
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.