cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
NNaj Regular Visitor
Regular Visitor

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

Accepted Solutions
Tahreem24 New Contributor
New Contributor

Re: Refer to previous/next row in a calculated column

@NNaj ,

 

  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! 

View solution in original post

3 REPLIES 3
Tahreem24 New Contributor
New Contributor

Re: Refer to previous/next row in a calculated column

@NNaj ,

 

  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! 

View solution in original post

NNaj Regular Visitor
Regular Visitor

Re: Refer to previous/next row in a calculated column

 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?

Tahreem24 New Contributor
New Contributor

Re: Refer to previous/next row in a calculated column

@NNaj ,

 

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! 

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)