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
Likhitha
Helper IV
Helper IV

Doubt regarding about calculating difference between dates

Hello All,

I'm having a status column and date column.I need to calculate datediff between preceding dates.How to do that?

IMG_20191218_210325.jpg

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Try this calculated column formula

=[Date]-CALCULATE(MAX(Data[Date]),FILTER(Data,Data[Date]<EARLIER(Data[Date])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-lid-msft
Community Support
Community Support

Hi @Likhitha ,

 

We can create a calculated table to meet your requirement:

 

Column =
DATEDIFF (
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER ( 'Table', 'Table'[Date] < EARLIER ( 'Table'[Date] ) )
    ),
    [Date],
    DAY
)

 

5.jpg

 


If it doesn't meet your requirement, Please show the exact expected result based on the Tables that you have shared.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-lid-msft  

I have one date column from which i need to calculate the net working dates with time duration.

What i have did is created a calendar table from which i calculated the sum of weekdays am achieving the networking days, but not the time included.

Can anyone help me how i can achieve networking days along with the time?

Screenshot of the raw data and the logic.

Logic.jpgIMG_20191227_114238.jpg

 
amitchandak
Super User
Super User

Try EARLIER

 

https://community.powerbi.com/t5/Desktop/Explanation-of-the-EARLIER-formula/td-p/529469

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

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

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.