Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Maximum Date

      Dear Friends i need a small help How to write a DAX Start date : 7/10/2019 (MMDDYY) End Date : 8/6/2019 (MMDDYY) i need a minimum Date of end date output : 8/1/2019 i want to calc...
  • v-xicai's avatar
    7 years ago

    Hi Anonymous ,

     

    You may try to create measures like DAX below.

     

    DateDiff= DAY(LASTDATE(Table1[Date]))-1

     

    Best Regards,

    Amy

     

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

  • saykasku's avatar
    7 years ago

    Hi,

    I think You need this:

    DayDiff = 
    var _maxDate = MAX(time[dates])
    RETURN
    DATEDIFF(
        DATE(YEAR(_maxDate);MONTH(_maxDate);1);
        MAX(time[dates]);
        DAY
    )