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.
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
- bsas8 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.
- davidell8 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 - davidell8 years agoFrequent Visitor
Hi again.
Just an update.
I kinda of got the problem solved by using this code, where the .[Date] made the differenceYTD = TOTALYTD(SUM('Fact Orders'[OrderIntake_Lcy]);'Dim Calendar'[Date].[Date];ALL('Dim Calendar'[Date]);"4/30")Since I'm working with fiscal year I've specified "4/30" as my year end.
However I'm going to show YTD in a matrix with year as a column, but it only shows YTD values for the 2016 and not from may to may.
As illustrated below, the right YTD is the one seen in the bar chart for april (130.726). However in the matrix its 100.411. How can I show the correct YTD numbers in the matrix?
Thank you very much