Forum Discussion
Creating a measure using 2 dates based on if
I should add that these are tables stored on a server.
Appreciate any help.
Thanks
I have tried various versions of the measure above.
Paul_Petro , You have use max on date of date
Try like
old_date = if(month(max(Dates[Date]))>=10, calculate([Total sales], DATEADD(Dates[Date],-1099,DAY)), calculate([Total sales], DATEADD(Dates[Date],-1463,DAY)))
2 Replies
- amitchandakSuper User
Paul_Petro , You have use max on date of date
Try like
old_date = if(month(max(Dates[Date]))>=10, calculate([Total sales], DATEADD(Dates[Date],-1099,DAY)), calculate([Total sales], DATEADD(Dates[Date],-1463,DAY)))
- Paul_PetroNew Member
This is great and it works a treat with the exception in 1 week which is split, 31/12/2022 and 1/1/2023 fall in this same week. Using max applies the same offset to the whole week, where ideally it should apply -1099 to the dates in 2022 and -1463 to the dates in 2023. Not sure how I would get around this simply.