Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Filtering open tickets based on date

Hi, I have a table called testdata  that contains support tickets with an Id , Opened Date and Closed Date like this,   I want to create a report and graps for a selected time period showing...
  • v-kkf-msft's avatar
    4 years ago

    Hi Anonymous ,

     

    Please try the following measures:

     

    MTicketsIn = 
    CALCULATE (
        COUNTROWS ( TestData ),
        FILTER (
            TestData,
            (
                TestData[Opened_Date] < MIN ( TestDates[Date] )
                    && ISBLANK ( TestData[Closed_Date] )
                    || (
                        TestData[Opened_Date] < MIN ( TestDates[Date] )
                            && TestData[Closed_Date] >= MIN ( TestDates[Date] )
                    )
            )
        )
    )
    MTicketsOut = 
    CALCULATE (
        COUNTROWS ( TestData ),
        FILTER (
            TestData,
            (
                TestData[Opened_Date] <= MAX ( TestDates[Date] )
                    && ISBLANK ( TestData[Closed_Date] )
                    || (
                        TestData[Opened_Date] <= MAX ( TestDates[Date] )
                            && TestData[Closed_Date] > MAX ( TestDates[Date] )
                    )
            )
        )
    )
    MCurrentTickets = 
    CALCULATE (
        COUNTROWS ( TestData ),
        FILTER (
            TestData,
            (
                TestData[Opened_Date] <= MIN ( TestDates[Date] )
                    && ISBLANK ( TestData[Closed_Date] )
                    || (
                        TestData[Opened_Date] <= MIN ( TestDates[Date] )
                            && TestData[Closed_Date] >= MAX ( TestDates[Date] )
                    )
            )
        )
    )
    MClosedTickets = 
    CALCULATE (
        COUNTROWS ( TestData ),
        FILTER (
            TestData,
            (
                TestData[Closed_Date] >= MIN ( TestDates[Date] )
                    && TestData[Closed_Date] <= MAX ( TestDates[Date] )
            )
        )
    )

     

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

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