How to calculate sales for same dates every year?

mrxlsx

Board Regular
Joined
Dec 15, 2012
Messages
95
Hi all,

I have the obvious relationships in my power pivot data model. I have 2 tables....Sales and Dates

DimDate[DateKey] --> Sales[Orderdate]

I want to calculate sales for the following specific dates and slice them by years.


  1. Jan-1st to Jan-1st is called NewYearSales,
  2. Dec-25th to Dec-25th is called Christmas Sales,
  3. Jan-14th to Jan-16th is called PongalSales.

This is to compare how these Festival sales are faring when compared to other sales measures like TotalSales.



This is a cross post from Here:

I tried this but not working:

PongalSales :=
CALCULATE (
[TotalSales],
DATESBETWEEN (
DimDate[Datekey],
FIRSTDATE ( DimDate[Datekey] ),
FIRSTDATE ( DimDate[Datekey] ) + 15
)
)


I tried this also, not working:

PongalSales :=
CALCULATE (
[TotalSales],
DATESBETWEEN (
DimDate[Datekey],
DATE ( YEAR ( DimDate[CalendarYear] ), 1, 1 ),
DATE ( YEAR ( DimDate[CalendarYear] ), 1, 15 )
)
)



This is working, but I can't slice this by Years....got it..?

PongalSales :=
CALCULATE (
[TotalSales],
DATESBETWEEN ( DimDate[Datekey], "1/1/2007", "15/1/2007" )
)


Any clue, advance thanks!

 
Last edited:

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top