Forum Discussion

pete1234's avatar
pete1234
Frequent Visitor
1 year ago
Solved

Filter for previous month on KPI visual

Hello,

 

I have a ticketing system connected to a Power BI database. I have three KPI indicators running down the side. I want to have the target to be exactly the same as the measured value, but for the previous month.

For example, the KPI Slow Responses This Month sums the count of slow response flags within a column, with a "current month" filter on there. I would like the target to be a count of slow response flags, but with a "previous month" filter on there. I do have this filter available, but how do I incorporate the two. 

Will I need a new measure that filters the value with the previous month?


Thanks

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from some_bih , please allow me to provide another insight:

    Hi, pete1234 

    Regarding the issue you raised, my solution is as follows:

    1.First I have created the following table and the column names and data are the data you have given:

    2. Below are the measure I've created for your needs:

    Current month count = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),MONTH('Table'[Date])=MONTH(TODAY())))
    Last month count = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),MONTH('Table'[Date])=MONTH(TODAY())-1))
    

    3.Here's my final result, which I hope meets your requirements.
     

     Please find the attached pbix relevant to the case.

     

    Best Regards,

    Leroy Lu

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

4 Replies

  • some_bih's avatar
    some_bih
    Community Champion

    Hi pete1234 try with relative date filter, check link, and see result and then create measure eventually

    • pete1234's avatar
      pete1234
      Frequent Visitor

      Can I incorporate this into the KPI target

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Thanks for the reply from some_bih , please allow me to provide another insight:

        Hi, pete1234 

        Regarding the issue you raised, my solution is as follows:

        1.First I have created the following table and the column names and data are the data you have given:

        2. Below are the measure I've created for your needs:

        Current month count = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),MONTH('Table'[Date])=MONTH(TODAY())))
        Last month count = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),MONTH('Table'[Date])=MONTH(TODAY())-1))
        

        3.Here's my final result, which I hope meets your requirements.
         

         Please find the attached pbix relevant to the case.

         

        Best Regards,

        Leroy Lu

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

  • some_bih's avatar
    some_bih
    Community Champion

    Hi pete1234 I am not sure that you consider KPI target but filter should work as described on link