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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anduve11
Frequent Visitor

YTD and PYTD for Specified Time Frame

I'm trying to calculate how our camp registrations are pacing compared to PY.  I know I need a YTD and PYTD calculation.  The registration opens on October 1st and runs until Aug 31st. Right now my YTD calculation is looking at all registrations starting on January 1st.  I'm able to make it work with the two measures below but I have to manually go in and update the date filter everyday.  This is annoying and not sustainable.   I'm looking for a way to not have to update the date or get rid of it so the table looks at just registrations starting Oct 1, 2017 - Current Date.  Then I need to see PY for October 1, 2016 - Current Day, 2016.  Any help would be greatly appreciated.

 

YTD = TOTALYTD(sum(Registrations[Quantity]),'Dim Date'[Date Key],all('Dim Date'),"09-30")

PYTD = CALCULATE([_YTD],SAMEPERIODLASTYEAR('Dim Date'[Date Key]))

 

 

I also tried this YTD measure and I can't get it to work either

 

YTD_Campers =
CALCULATE(
Sum (Registrations[Quantity]),
FILTER(
All('Dim Date'),
Year ('Dim Date'[Date Key] ) = YEAR(TODAY())
&& 'Dim Date'[Date Key] <= TODAY()
)
)Data SetData SetDate FilterDate FilterIdeal OutcomeIdeal Outcome

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee

 

@Anduve11

You can create a calculated column as below, then set the filter column = true.

 

column = 'dim date'[Date key]<=TODAY()

 

View solution in original post

2 REPLIES 2
cwoo
Regular Visitor

I  am having  a similar Problem and no one  seems to have a solution  for this basic task. 

 

Solution  go to  tableau .

 

colin 

Eric_Zhang
Employee
Employee

 

@Anduve11

You can create a calculated column as below, then set the filter column = true.

 

column = 'dim date'[Date key]<=TODAY()

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.