Forum Discussion
YTD time intelligence wrong numbers-Odd behavior?
Hi davidell,
You need to use MIN and MAX in calculate. E.G Calculate(SUM([sales]), Filter(table, and( your end date <= Max(alldates.[date]), your end date >= Min(alldates.[date]))))
or
total sale during 2015/1/1 to 2015/7/20 = CALCULATE(SUM(Sales[SALE]),AND(Sales[DATE]<=DATE(2015,7,20),Sales[DATE]>=DATE(2015,1,1)))
Also you can searc in YTD solved problems here. There are a lot of similar topics.
- davidell9 years agoFrequent Visitor
Hi bsas,
Thank you very much for your reply.I've tried what you said and it works out. However I want the YTD to automatically detect the current year and compare with other years.
Basically I want to create a matrix in which I can compare YTD, LY and change between YTD and LY across different dates such as 2010,2011,2012,...2018.
Since I'm not a DAX jedi yet, I kind of lack the insight in DAX.
I've tried searching the forum and found many similar problems, however none of them which I could get to work:
/David- bsas9 years ago
Post Patron
If you wanna detect current year then use Year(Today()) in your calculations. I'll look for a solution in the evening.
- davidell9 years agoFrequent Visitor
Thanks alot bsas I really appreciate your help.
Just a side note. It's pretty important for me to be able to specify a start date, since it's fiscal years I'm going to calculate, and it's not starting 1/1.
/David