Forum Discussion

learner03's avatar
learner03
Post Partisan
4 years ago
Solved

Time difference between Today and first timestamp

I have 2 Table- Receipt Jobs   Receipt ID 123 345 567 789 and Receipt_lines           Recepit ID Item code timestamp 123 abc 7/02/2022 6:59 345 def ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi learner03 ,

     

    Please try:

    Count = 
    var _first=CALCULATE(MIN('Receipt_lines'[timestamp]),ALLEXCEPT(Receipt_lines,Receipt_lines[Recepit ID]))
    return CALCULATE(COUNTROWS('Calendar'),FILTER('Calendar', [Date]>=_first && [Date]<=NOW()&& [Flag]=1 ))
    Measure = CALCULATE([Count], FILTER('Receipt_lines',[Recepit ID]=MAX('Receipt Jobs'[Receipt ID])))

     

    Output:

     

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