Forum Discussion
KristofferAJ
Helper III
4 years agoTime between two dates with rules
Hi! I have a question for a formula I would like to create. In theory it's only two dates which needs to be subtracted in order to provide time between 'Dispatch' and 'last sold date' However I hav...
- Anonymous4 years ago
KristofferAJ Please make a small addition in the ALLEXCEPT() function in measure to take both fruit and country into consideration.
DateDifference =VAR maxdate =CALCULATE (MAX ( Table1[LastSoldDate] ),ALLEXCEPT ( Table1, Table1[Country], Table1[Fruit] ))VAR leastdate =SELECTEDVALUE ( Table1[Dispatch] )VAR diff =CALCULATE (DATEDIFF ( leastdate, maxdate, DAY ),ALLEXCEPT ( Table1, Table1[Account ID] ))RETURNdiff + 0 & " Days"Please accept it as a solution if it matches your requirement🙂
v-cazheng-msft
Community Support
4 years agoHi KristofferAJ ,
May I know whether your problem has been resolved? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun