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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
UpharAnand
Helper II
Helper II

How to get previous row

Hi,

I wanto see the previous "Subscription Cancellation Date" . The thing is that I have multiple sourceid and I am unable to get the output.. Please see the below screenshot.

UpharAnand_0-1719315640277.png

I want expected result as:

UpharAnand_1-1719315732292.png

Just check the Subscription Cancelletion Date. in the excel sheet it is showing previous value for the sourceid.

 

Please help me.

I am attaching the power BI file

:https://drive.google.com/file/d/1onGdEpyBkffjbdg_OHNIrA-SKvWGjG4e/view?usp=drivesdk

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from @rajendraongole1 , please allow me to provide another insight:

Hi  @UpharAnand ,

There may be scenarios where both the top and bottom rows have the same date, resulting in the top row of the same date not being displayed, we can create an index to give each row a separate tag.

Here are the steps you can follow:

1. In Power Query -- add Column – Index Column – From 1.

vyangliumsft_0-1719386817279.jpeg

2. Create calculated column.

Test =
MAXX(
    FILTER('Subscriptions',
    'Subscriptions'[Source Id]=EARLIER('Subscriptions'[Source Id])&&
  'Subscriptions'[Status]="Cancelled"&&
    'Subscriptions'[Index]<EARLIER('Subscriptions'[Index])),[Subscription Cancellation Date])

3. Result:

vyangliumsft_1-1719386817283.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks for the reply from @rajendraongole1 , please allow me to provide another insight:

Hi  @UpharAnand ,

There may be scenarios where both the top and bottom rows have the same date, resulting in the top row of the same date not being displayed, we can create an index to give each row a separate tag.

Here are the steps you can follow:

1. In Power Query -- add Column – Index Column – From 1.

vyangliumsft_0-1719386817279.jpeg

2. Create calculated column.

Test =
MAXX(
    FILTER('Subscriptions',
    'Subscriptions'[Source Id]=EARLIER('Subscriptions'[Source Id])&&
  'Subscriptions'[Status]="Cancelled"&&
    'Subscriptions'[Index]<EARLIER('Subscriptions'[Index])),[Subscription Cancellation Date])

3. Result:

vyangliumsft_1-1719386817283.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

rajendraongole1
Super User
Super User

Hi @UpharAnand - Can you try the below calcuated column:

Previous Subscription Cancellation Date =
VAR CurrentSourceID = Subscriptions[sourceid]
VAR CurrentActivationDate = Subscriptions[Subscription Activation Date]
RETURN
CALCULATE(
MAX(Subscriptions[Subscription Cancellation Date]),
FILTER(
Subscriptions,
Subscriptions[sourceid] = CurrentSourceID &&
Subscriptions[Subscription Activation Date] < CurrentActivationDate
)
)

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.