Forum Discussion

NotMyJob's avatar
NotMyJob
Helper III
1 year ago
Solved

Identify items within a specific timeframe

Hopefully this is the right forum for this question, and that is if anyone would know how to calculate or create a Card that would have a calculation which would determine how many of 'X' events were closed out before End of Year.

 

Example:  50 tickets were created in 2024.  30 were closed out.  No problem so far, however, if 10 of those were not slated to be closed out until after 31 Dec 2024, those need to be eliminated from the equation so the Closed Percentage is accurate/not misleading.

 

I suck at formulas... sorry.

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi NotMyJob 

     

    Thank you very much hnguy71 for your prompt reply.

     

    Here are some ideas I would like to offer for your question:

     

    Here's some dummy data

     

    “Table”

     

    Create a measure.

     

    ClosedPercentage = 
    VAR ClosedBeforeEOY = 
    CALCULATE(
        COUNTROWS('Table'),
        'Table'[ClosedDate] <= DATE(2024, 12, 31)
    ) // Number of events closed before 12/31/2024
    VAR TotalCreated2024 = 
    CALCULATE(
        COUNTROWS('Table'),
        YEAR('Table'[CreatedDate]) = 2024
    ) // Total number of events created in 2024
    RETURN
    DIVIDE(
        ClosedBeforeEOY,
        TotalCreated2024,
        0
    ) // Calculate the percentage of closed events

     

    Here is the result.

     

     

    If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.

     

    Regards,

    Nono Chen

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

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi NotMyJob 

     

    Thank you very much hnguy71 for your prompt reply.

     

    Here are some ideas I would like to offer for your question:

     

    Here's some dummy data

     

    “Table”

     

    Create a measure.

     

    ClosedPercentage = 
    VAR ClosedBeforeEOY = 
    CALCULATE(
        COUNTROWS('Table'),
        'Table'[ClosedDate] <= DATE(2024, 12, 31)
    ) // Number of events closed before 12/31/2024
    VAR TotalCreated2024 = 
    CALCULATE(
        COUNTROWS('Table'),
        YEAR('Table'[CreatedDate]) = 2024
    ) // Total number of events created in 2024
    RETURN
    DIVIDE(
        ClosedBeforeEOY,
        TotalCreated2024,
        0
    ) // Calculate the percentage of closed events

     

    Here is the result.

     

     

    If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.

     

    Regards,

    Nono Chen

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

  • Hi NotMyJob 

    That's pretty easy to do. Can you provide us with a sample of your data wth expected results? If you can obscure the confidential information and share your current measure tha would be great.