Forum Discussion
Same Day Last Month
- Anonymous2 years ago
Hi Anonymous ,
Based on your statement, I make a new expression You can check the result as follows:
Measure:
Last month same day = var _pre= EOMONTH(MAX('Table'[DATE]),-1) return DATE(YEAR(_pre),MONTH(_pre),DAY(MAX('Table'[DATE])))Perhaps this will work, and if you have any questions, please provide me a simple sample to make sure we can better solve the problem for you!
An attachment for your reference. Hope it helps.
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for reply.
This will work for disconnected tables but in my model, dim_date table connected to Fact table. In this case, your code is not working
Hi Anonymous ,
Based on your statement, I make a new expression You can check the result as follows:
Measure:
Last month same day =
var _pre= EOMONTH(MAX('Table'[DATE]),-1)
return DATE(YEAR(_pre),MONTH(_pre),DAY(MAX('Table'[DATE])))
Perhaps this will work, and if you have any questions, please provide me a simple sample to make sure we can better solve the problem for you!
An attachment for your reference. Hope it helps.
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.