Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

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 goal within the KPI? I.e. When it turns february, it shows as 22, March is 44, April 66 etc..

 

I created a new measure simply as 'Prop = 22' so that if the target changes next year I can rename the variable to say 'Prop = 24' and the YTD will change with it.

 

Having trouble as I am new to Power BI and using a live dataset, thanks!

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

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 VahidDM_0-1628683383995.png !!

View solution in original post

3 REPLIES 3
VahidDM
Super User
Super User

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 VahidDM_0-1628683383995.png !!

Anonymous
Not applicable

Ah yes thats great! Thanks @VahidDM 

Anonymous
Not applicable

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.