Forum Discussion
Creating a YTD flag on a date
Hi Anonymous,
Ideally does anyone have a formula to flag a day as being in the last year to date. I suppose I could do with a Financial Year that starts on the 1st of July each year.
The DATESYTD function has an optional parameter called year_end_date, which is a literal string with a date that defines the year-end date. The default is December 31.
So in your scenario, you can specify it as "July 1" in your YTD measure. The formula below is for your reference. :smileyhappy:
YTD Sales=
CALCULATE (
SUM ( InternetSales_USD[SalesAmount_USD] ),
DATESYTD ( DateTime[DateKey], "July 1" )
)
Regards
- Anonymous8 years agoNot applicable
Hi
Thanks for the response.
I am not sure about the Summarize function? Do you mean to create a column with an amount of sales in the current year to date? I have done this but I am unsure what the result is telling me? It seems to be multiplying all of the sales data exponentially and not really showing a year to date figure. Do you know how the field would be queried or displayed? Also, why can't a flag be added to the date table to show the date as being in the last year to date as opposed to creating the sum?
Thanks