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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Irwin
Helper IV
Helper IV

Need help - How to implement YTD in my measurement

Hi Guys,

 

I have the below measurement. So far I have put a filter on it to only use data from "In this year", however I need it to be YTD.

I know there exits a "TOTALYTD". Can this be used somehow in my measurement?

 

Thank you for all help. Much appreciated. 🙂

 

Completion Rate =
VAR OffTime =
Calculate (
Counta ('Performance Management'[CompletionStatus]),
Filter ('Performance Management', 'Performance Management'[CompletionStatus] = "Completed Off Time")
)
VAR OnTime =
CALCULATE(
COUNTA('Performance Management'[CompletionStatus]),
FILTER('Performance Management', 'Performance Management'[CompletionStatus] = "Completed On Time")
)
RETURN
Divide ( OnTime, OnTime + OffTime) + 0
1 ACCEPTED SOLUTION

In such a scenario you will want to add a TODAY() based filter.  You can choose if you want to do this as a calculated column (which would required frequent, ie daily, refreshes of your import mode data source) or a measure if your data source is Direct Query.

View solution in original post

7 REPLIES 7
lbendlin
Super User
Super User

 

Completion Rate =
Var CurrentYear = <calculation for year>
VAR OffTime =
Calculate (
Counta ('Performance Management'[CompletionStatus])
,'Performance Management'[CompletionStatus] = "Completed Off Time"
,'Performance Management'[Year]=CurrentYear
)
VAR OnTime =
CALCULATE(
COUNTA('Performance Management'[CompletionStatus])
,'Performance Management'[CompletionStatus] = "Completed On Time"
,'Performance Management'[Year]=CurrentYear
)
RETURN
Divide ( OnTime, OnTime + OffTime) + 0

 

 

Here would be one option.  

Unfortunately that doesnt work. Syntax error.
If it did work I think this would still be current year? I need YTD 

 

 

Thank you for your response.

Did you adjust the formula according to your column names?

Please explain the difference between"current" and "YtD".

Hi yes of course.
So "Current year" is all performance activities completed in this year. That means that some activities can already be completed for december. We are not in december yet, so I do not want to include these in my calculation.

 

As you probably are very aware PBI has the option to add date filters to the figures (ie. "In this year"). This shows all performance management activites also those completed already but schedueled for december.

 

I want PBI to just do the above measure from 1. of january 2021 till today. 

 

Does that make sense?

In such a scenario you will want to add a TODAY() based filter.  You can choose if you want to do this as a calculated column (which would required frequent, ie daily, refreshes of your import mode data source) or a measure if your data source is Direct Query.

Hi again,
It took me 2 min to create

" Today or Before = IF('Performance Management'[Deadline] <= TODAY(), True, False) " 

Using my original formula and this as a filter with "True" plus my earlier "In this year" filter gives me the result I wanted.

 

Thank you so much. So easy. 🙂

Sounds like this might be the solution. I have refreshes on my dataset twice a day. I will try to read somemore and see if I can come up with a solution. Thank you for your assistance.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors