Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

KPI Target YTD with Live Dataset

Hi,   I'm trying to format some KPIs, I have a monthly goal of '22' and it is fixed at 22 per month for the year. How do I write the DAX for YTD goal whereby my report shows the previous months goa...
  • VahidDM's avatar
    5 years ago

    Hi Anonymous 

     

     

    Well, your question is not clear, but if you want to calculate the KPI based on the Today Date, you can use the below code:

    KPI=
    VAR _Month_Goal = 22 
               // Monthly Goal
        RETURN
            VAR _Date =
                TODAY () 
               // you can change this to any date
            RETURN
                VAR _MonthP =
                    MONTH ( _Date ) 
               // this Var shows the month of the _Date
                RETURN
                    ( _MonthP - 1 ) * _Month_Goal

     

    Did I answer your question? Mark my post as a solution!

    Appreciate your Kudos  !!