Forum Discussion
YTD Over Years
- Anonymous2 years ago
Hi All
Firstly Ashish_Mathur and lbendlin thank you for yours solutions!
And Mkobayashi ,As I understand it, you need to dynamically calculate each year's data to today's data based on the exact date of each day, right?
The data below is calculated using today's date as an example.YTD_by_Year = CALCULATE( SUM('sales_data_2020_2024'[Sales]), DATESYTD('sales_data_2020_2024'[Date],"12/31"), 'sales_data_2020_2024'[Date]<=DATE(YEAR('sales_data_2020_2024'[Date]),MONTH(TODAY()),DAY(TODAY())))YTD_by_2020 = CALCULATE(SUM(sales_data_2020_2024[Sales]),'sales_data_2020_2024'[Date]>=DATE(2020,1,1)&&'sales_data_2020_2024'[Date]<=DATE(2020,9,11))I hope my answer has helped you with your question, if you have any further questions you can always contact me and I will get back to you as soon as I see the message!
Hope it helps!
Best regards,
Community Support Team_ Tom ShenIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi All
Firstly Ashish_Mathur and lbendlin thank you for yours solutions!
And Mkobayashi ,As I understand it, you need to dynamically calculate each year's data to today's data based on the exact date of each day, right?
The data below is calculated using today's date as an example.
YTD_by_Year =
CALCULATE(
SUM('sales_data_2020_2024'[Sales]),
DATESYTD('sales_data_2020_2024'[Date],"12/31"),
'sales_data_2020_2024'[Date]<=DATE(YEAR('sales_data_2020_2024'[Date]),MONTH(TODAY()),DAY(TODAY())))YTD_by_2020 = CALCULATE(SUM(sales_data_2020_2024[Sales]),'sales_data_2020_2024'[Date]>=DATE(2020,1,1)&&'sales_data_2020_2024'[Date]<=DATE(2020,9,11))
I hope my answer has helped you with your question, if you have any further questions you can always contact me and I will get back to you as soon as I see the message!
Hope it helps!
Best regards,
Community Support Team_ Tom Shen
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- Mkobayashi1 year agoNew Member
Hi Tom, thank you very much, that is what i needed!