Forum Discussion
if Min date then 0
- Anonymous8 years ago
Hello ilcaa72
I made this, in my example works very well according to your requeriments, try it, and if doesn't work, I can work on another formula.
DIFF =
VAR Minimun_Date =
CALCULATE ( MIN ( Date[Date] ), ALLSELECTED ( Date[Date] ) )
VAR Date_to_Compare =
MIN ( Date[Date] )
RETURN
IF (
Date_to_Compare = Minimun_Date,
0,
SUMX ( MatchRate, MatchRate[Rate] )
- CALCULATE (
SUMX ( MatchRate, MatchRate[Rate] ),
PREVIOUSMONTH ( MatchRate[Date] )
)
)Good Luck.
ilcaa72 What Date is the one you use on the slicer?
i changed the ALLSELECTED to ALL and it is working correctly (changed your forumula so i can mark as correct).. so thank you....
BUT how can i get the difference in my table, the end results is to place it in a line graph. i know have all zeros. (screenshot) could my original formula be wrong? should I not use the SUMX()
- Anonymous8 years agoNot applicable
Hi ilcaa72
I should work with the ALLSELECTED option, but in your case there's something important you are using the function "PREVIOUSMONTH" this is a time-intelligence function which works perfectly with a calendar table, so I encourage you to create a calendar table, maybe with that the the informations displayed will be the one you expected.
as you can see in my example works, but I'm using a normal SUM, I'm no using any time-intelligence function.