Forum Discussion

JustNewbie's avatar
JustNewbie
Helper I
3 years ago
Solved

Calculate dates between 2 tables (need help)

Hi,

I know there's alot of posting abt how to calulate the date difference between 2 tables. I have go through all the old posts and comments and i still cant solved my problems..hope someone can help..

 

Here's my problem I have connected the table, and use the dax below but it give me wrong result..

Im not sure where's the issue..

 

Dax

 

Connection

 

  • Hi JustNewbie 

    please try this ,

    diff = 
    var _date1=MAXX(FILTER(Table1,Table1[Key]=MAX(Table2[Key])),[Date])
    var _date2=MAX(Table2[Date])
    return DATEDIFF(_date1,_date2,DAY)

    sample data

    result

    Best Regards,

    Community Support Team _Tang

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

2 Replies