Forum Discussion

Mariska123's avatar
Mariska123
Frequent Visitor
8 years ago

Calculate date difference

Hi Community,

 

I'm trying to calculate the date difference between the bold dates:

 

Client_NRSit_NRMutationInputStart DateEnd Date
11NW1-3-20151-4-201528-2-2016
12SC3-6-20151-3-2016 

 

I tried different DAX-formulas, but I cannot get it right. Is there somebody here who can help me?

 

 

5 Replies

    • Mariska123's avatar
      Mariska123
      Frequent Visitor

      Hi Phil_Seamark,

       

      Yes, that's right. The date I want to create is the difference between the startdate of mutation = NW and the inputdate of the mutation = SC

      • parry2k's avatar
        parry2k
        Super User

        try this measure

         

        Days Difference = 
        var y = calculate(max(Dt[Start Date]), Filter(ALLSELECTED(Dt), Dt[Sit_NR] < max( Dt[Sit_NR] )))
        return   datediff(y, MAX(Dt[Input]), DAY)