cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
knotpc Regular Visitor
Regular Visitor

TOTALYTD Cannot get to calculate YTD through Today

Having trouble getting a TotalYTD where I have a Forecast for the entire year loaded. The Forecast has SKU, QTY and DATE. The DATE is related to my Calendar table. What I want is to have the Forecast total for the year to date. Below is what I have tried thus far. 

 

  • Unit Forecast YTD = TOTALYTD([Unit Forecast], 'Calendar [Date])
    • I get the TOTAL Forecast for the entire year.  What I need is the forecast from January through TODAY. 
  • Unit Forecast YTD = VAR RetVal = TOTALYTD(SUM(Forecast[UnitForecast]),'Calendar'[Date])RETURN IF(MAX('Calendar'[Date])<=TODAY(), RetVal,0)
    • For this one I get 0

The data is pretty straight forward. see example below:

 

DateQtySKU
1/1/201910012345
2/1/201920012345
3/1/201920012345
4/1/201920012345
5/1/201920012345
6/1/201920012345
7/1/201950012345
8/1/201950012345
9/1/201950012345
10/1/201950012345
11/1/201950012345
12/1/201950012345

 

What I need to calculate is 1600, representing the forecast from January - TODAY. What I get is either 4100 using the first formula or Zero using the second formula. 

 

Any help or direction in solving this would be much appreciated. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: TOTALYTD Cannot get to calculate YTD through Today

@knotpc solution is attached. just focus on forecast and calendar table and one measure 

 

There are other tables in the files, just ignore those. cheers!!

 

Total YTD Upto Today = TOTALYTD( SUM( Forecast[Qty] ), 'Calendar'[Date], 'Calendar'[Date] <= TODAY() )





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

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





View solution in original post

1 REPLY 1
Highlighted
Super User
Super User

Re: TOTALYTD Cannot get to calculate YTD through Today

@knotpc solution is attached. just focus on forecast and calendar table and one measure 

 

There are other tables in the files, just ignore those. cheers!!

 

Total YTD Upto Today = TOTALYTD( SUM( Forecast[Qty] ), 'Calendar'[Date], 'Calendar'[Date] <= TODAY() )





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

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 332 members 3,227 guests
Please welcome our newest community members: