Forum Discussion
DATESYTD not working
- 1 year ago
Hi Greg_Deckler ,
And first, thank you for your answer. I'm sorry I took some time to answer, since I took a lot of time to understand well all the info in the links you shared.
I tried to code some of the functions the hard way, and it seems to get me some results ! But since I am a beginner, I still do not understand all I am coding with those hard way function ^^
So I keep trying your solution, I keep on trying to understand all of this, and when I get a clear list of questions, i come back to this discussion.
Hi YoShan65 ,
Did Greg_Deckler's reply help you? If so, please accept it as solution.
BTW, DATESYTD is a DAX function in Power BI Desktop used to calculate year-to-date values. It's particularly useful for time series analysis, especially for calculating cumulative values from the beginning of the year to a specified date.
YTD Sales = CALCULATE(
SUM('Table'[Sale]),
DATESYTD('Table'[Date])
)
Explanation
SUM('Table'[Sale]): Calculates the total sales amount.
DATESYTD('Table'[Date]): Generates a date range from the beginning of the year to the current date.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Anonymous ,
And thank you a lot for your answer.
I do understand all of these function, just it seems it does not work with me. Could you please give me the pbix file you used to send your screen shot? Once again, if I do exactly the same as you do, my YTD Sales column displays the exact same values as my Sum of Sales column, that is what I do not understand.
I would like to get your file so I could check if there is something in my writing (and then your file will work) or if there is some thing in my settings, somewhere ...