Forum Discussion
Mariska123
8 years agoFrequent Visitor
Calculate date difference
Hi Community,
I'm trying to calculate the date difference between the bold dates:
| Client_NR | Sit_NR | Mutation | Input | Start Date | End Date |
| 1 | 1 | NW | 1-3-2015 | 1-4-2015 | 28-2-2016 |
| 1 | 2 | SC | 3-6-2015 | 1-3-2016 |
I tried different DAX-formulas, but I cannot get it right. Is there somebody here who can help me?
5 Replies
- Phil_SeamarkMicrosoft Employee
HI Mariska123
Is the value you want to calculate always between two records with consecutive Sit_NR numbers?
- Mariska123Frequent 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
- parry2kSuper 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)