Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Bolijay00
Contributor III
Contributor III

2 months Prior and 2 months after Sales

 

hi all

I have a challenge at work, i am trying to show sales for 2 months prior and two months after any time i select an asset, the idea is to see the sales perfomance from the date it was changed, i.e  two months before the change date and two months after the change date, i hav trked this for current selection...sum({$<[Change date] = {">=$(MonthStart(Max([Change date]))) <=$(MonthEnd(Max([Change date]))))"}>} ANB)... also this for 2 months after....sum({$< [Collection date], [Change date] = {">=$(MonthStart(Max([Change date],2))) <=$(MonthEnd(Max([Change date]),2)))"}>} ANB) and 2 months before sum({$< [Collection date], [Change date] = {">=$(MonthStart(Max([Change date],-2))) <=$(MonthEnd(Max([Change date]),-2)))"}>} ANB) but i doesn't seem to give the desired output.  I have attached a picture of the table, i just want 2 measures for 2 months before and 2 months after for any slected asset . Thank you.

anb==Salesanb==Sales

Labels (3)
2 Replies
krishna_2644
Specialist III
Specialist III

Some dummy data to work on please?

Bolijay00
Contributor III
Contributor III
Author

Kaggle.com