Forum Discussion
Dynamic YTD across multiple years
- 5 years ago
We finally came up with a measure that works for our purpose:
YTD sales units =
TOTALYTD(SUM('Sales'[Sales units]); 'Sales'[Date];MONTH('Sales'[Date])<=MONTH(NOW())
Kt1097
Create the following measure, it will show you the total ytd from the available starting date in your table
YTD Sales =
IF(
MAX(Sales[Date]) > EOMONTH(TODAY(),-1),
BLANK(),
CALCULATE(
SUM(Sales[Sales Units]),
FILTER(
ALLSELECTED(Sales[Date]),
Sales[Date] <= MAX(Sales[Date])
)
)
)________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
Unfortunately, it doesn't work either. It just displays all sales from the available starting date until now but not the sales made in the last years until november.
- Anonymous5 years agoNot applicable
Hi Kt1097,
Fowmy 's formula looks well, I'm not so sure why they do not work on your side. Can you please share a pbix file with some dummy data and expected results to help us clarify your scenario and test coding formula?
How to Get Your Question Answered Quickly
Regards,Xiaoxin Sheng