Forum Discussion
Shift a Measure one Date Down
Hello Everyone,
I have atable like this :
I woulk like to shift the measure down by one date so that 17 alighns with the 20th and 42 alighns with the 19th etc.
This is how I am calculating the measure :
Hey there!
To shift the measure down by one date, so that values from a particular date align with the next date in the table, you need to modify your DAX calculation to reference the previous day's value.
Try this:
Shifted Today Orders Test =
VAR CurrentDate = SELECTEDVALUE(Orders[Date])RETURN
CALCULATE(
[Today Orders Test],
Orders[Date] = CurrentDate - 1
)Hope this helps!
😁😁
2 Replies
- freginierSolution Sage
Hey there!
To shift the measure down by one date, so that values from a particular date align with the next date in the table, you need to modify your DAX calculation to reference the previous day's value.
Try this:
Shifted Today Orders Test =
VAR CurrentDate = SELECTEDVALUE(Orders[Date])RETURN
CALCULATE(
[Today Orders Test],
Orders[Date] = CurrentDate - 1
)Hope this helps!
😁😁
- AnonymousNot applicable
Hi Khomotjo
I notice that the dates are not consecutive, which previous date should be chosen when the date is not consecutive? Let's take 2025/2/17 as an example, its previous date in the table visual is 2025/2/12, do you want to get the value on this date? Or do you want to get the count value of 2025/2/16? Minusing 1 from the current date will only give you the previous calendar date. Not sure which one is what you expect?
Best Regards,
Jing