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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
atacuboy
Frequent Visitor

Return Previous Date or Calculate Difference from Previous Date in Earlier Row

Hello Everyone,

 

I'm trying to get the difference between the date at the current row and the date from a previous row, similar to the table below. 

Would any of you know how to create the column in red font below?

 

DatePrevious DateDifference
June 18, 2020--
November 15, 2020June 18, 2020150
March 2, 2021November 18, 2020107
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @atacuboy 

If you are looking for creating a column, try something like below.

 

Picture5.png

 

 

previous date column =
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER ( 'Table', 'Table'[Date] < EARLIER ( 'Table'[Date] ) )
)

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Linkedin: https://www.linkedin.com/in/jihwankim1975/


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi, @atacuboy 

If you are looking for creating a column, try something like below.

 

Picture5.png

 

 

previous date column =
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER ( 'Table', 'Table'[Date] < EARLIER ( 'Table'[Date] ) )
)

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Linkedin: https://www.linkedin.com/in/jihwankim1975/


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Thank you so much!

amitchandak
Super User
Super User

@atacuboy , Create a new column like

datediff([Date], maxx(table, [Date] < earlier([Date]),[Date]), day)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you also for replying!

Helpful resources

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

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.