Forum Discussion
Why is my last quantity formula not working
- 3 years ago
rpinxt CALCULATE gets wonky with single tables sometimes. Try something like below. If that doesn't work then it is quite likely that you are running afoul of auto-exist where it doesn't even try the calculation.
LastQty Measure = VAR __Max_TS = MAXX(ALL('AVN PPS Daily_LC1510'),[lc_timestamp]) VAR __Curr_TS = MAX(''AVN PPS Daily_LC1510', [lc_timestamp]) VAR __Result = IF(__Max_TS = __Curr_TS, [Quantity], 0) RETURN __Result - 3 years ago
Greg_Deckler just to let you know that I got things working now.
As you see also your method is working.
Not entirely sure but I started over and made sure I had a pure direct query storage mode.
First I had a mixed mode because I made a Metrics table in which I stored my measures.
It is the only thing I think changed....
However I now made my %Done card with this formula :
Thanks for looking into this with me 😄
Bit more detail but this is really anyoing me....should work should it not??
If you do not know what the correct formula is, but still see why mine should not work please let me know!!
- Greg_Deckler3 years ago
Community Champion
rpinxt CALCULATE gets wonky with single tables sometimes. Try something like below. If that doesn't work then it is quite likely that you are running afoul of auto-exist where it doesn't even try the calculation.
LastQty Measure = VAR __Max_TS = MAXX(ALL('AVN PPS Daily_LC1510'),[lc_timestamp]) VAR __Curr_TS = MAX(''AVN PPS Daily_LC1510', [lc_timestamp]) VAR __Result = IF(__Max_TS = __Curr_TS, [Quantity], 0) RETURN __Result- rpinxt3 years ago
Solution Sage
Thanks Greg_Deckler
Tried it but gives same result:Here "LastTime" compares lc_timestamp with LastTS.
So this proves that there is no difference in the timestamp and the max timestamp.
But still empty. Zeros are correct.
Apparently for the total it si working again...
But are you saying that my data is corrupted or what does "afoul of auto-exist" mean?