Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi All,
it's possibile calulate the sales between 2 dates? to be clear in my sales table have a column with promotion active during the period for each sku. i need calculate the sales 4 week before, during the promotion periodo and 4 week after. the sales table and my calendar are connected ma non active, i tried with first and last date and datediff, and after that i use datebetween, but i can show only the sales during the promotion i selected in the slicer...
Solved! Go to Solution.
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
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
Thanks for your help, but not working, i'm working with calendar table connected with my sales table, in the sales table one column contain the name of promotion, my goal is see the the 28 days before the start and the 28 before the end, in the same visualization with promotion period. i tried with date add and min and max but when i use the slicer to change promotion to see, the days after and before not showing, i can't understand what filter i need remove to see that results.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Create a CALENDAR() with the two dates and then use that as a filter.
Hi, i tried but calculate the sales only during the promotion timeline. I calulate the date before 4 week and after 4 week, and use calendar but i can see the sum between start and end date for promotion period.