calculate value between 2 date
- 1 year ago
Hello Mike91 ,
Firstly you need to setup the Calendar Table for getting the result you are for to start with you can try the below meaures and replace it with the Concern tables and columns whoch you..
If you already have the promotion period selected via a slicer, you can calculate the sales during the promotion using the datesbetween like below
SalesDuringPromotion =
CALCULATE(
SUM(Sales[SalesAmount]),
DATESBETWEEN(
'Calendar'[Date],MIN('Sales'[PromotionStartDate]),MAX('Sales'[PromotionEndDate])))You can calculate sales for the 4 weeks before the promotion with the Dateadd function..
SalesBeforePromotion =
CALCULATE(
SUM(Sales[SalesAmount]),
DATESBETWEEN(
'Calendar'[Date],DATEADD(MIN('Sales'[PromotionStartDate]), -28, DAY),MIN('Sales'[PromotionStartDate]) - 1))If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S