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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SErgey-kuznetso
Frequent Visitor

Next date

Hi, please help me with calculated column.

 

I have a column with the orders_id and dates sorted by ascending. I need to create another column with the dates but with the next date. Next, using the DATEDIFF function, I want to calculate the difference between these dates.


Example:

order_idcreated_atnext_date
2751208.10.2014 17:55:1414.10.2014 0:46:32
2798414.10.2014 0:46:3214.10.2014 14:14:07
2803614.10.2014 14:14:07and so on
.........

 

Screenshot:

image (1).png

 
2 REPLIES 2
amitchandak
Super User
Super User

@SErgey-kuznetso , Create a new column

Next Date = minx(filter(table,[created_at]>earlier([created_at])),[created_at])

nandukrishnavs
Super User
Super User

@SErgey-kuznetso 

 

Try this calculated column

next_date = MINX(FILTER(ALL('MyTable'[created_at]),'MyTable'[created_at]>EARLIEST('MyTable'[created_at])),'MyTable'[created_at])

Capture.JPG 

Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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