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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.