Forum Discussion

Bswuste's avatar
Bswuste
Frequent Visitor
2 years ago
Solved

MIN MAX question

Hi all, I have a question about MIN/MAX function. In the incident table, there is a CreationDate and a ClosureDate and I have a Date table. I want to know how many incidents are open at the begin...
  • Bswuste's avatar
    2 years ago

    Found it.
    I needed to remove the equal to sign. Now the numbers are correct.

    Msr_IncidentOpenatBeginningOfTimespan =
    VAR CurrentDate = MIN('Date'[Date])
    RETURN
    CALCULATE(
        COUNTROWS(Incidents),
        'Date'[Date]<= CurrentDate,   
       
    Incidents[closureDate] > CurrentDate
        ||
        ISBLANK(Incidents[closureDate]),
        USERELATIONSHIP(Incidents[creationDate], 'Date'[Date]))