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.
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!
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.
- Jan-1st to Jan-1st is called NewYearSales,
- Dec-25th to Dec-25th is called Christmas Sales,
- 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: