Forum Discussion
a column specified in the call to function 'dateadd' does not of type date. this is not supported
- Anonymous5 years ago
Hi AnandNamburi
In addition to amitchandak 's reply, I think you may want to calculate the sum of sales in last year.
You can try this measure:
M.PP1 = CALCULATE ( SUM ( Orders[Sales] ), FILTER ( ALL(Orders), Orders[Order Date].[Year] = MAX(Orders[Order Date].[Year])-1 ))Result is as below.
Or you can build a calendar table and relate two tables by date column.
Calendar Table:
Calendar = ADDCOLUMNS(CALENDAR(MIN(Orders2[Order Date]),MAX(Orders2[Order Date])),"Year",YEAR([Date]))Then build a measure as below.
2.PP1 = CALCULATE(SUM('Orders2'[Sales]),DATEADD('Calendar'[Date],-1,YEAR))Result is as below.
You can download the pbix file from this link: a column specified in the call to function 'dateadd' does not of type date. this is not supported
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi AnandNamburi
In addition to amitchandak 's reply, I think you may want to calculate the sum of sales in last year.
You can try this measure:
M.PP1 =
CALCULATE (
SUM ( Orders[Sales] ),
FILTER (
ALL(Orders),
Orders[Order Date].[Year]
= MAX(Orders[Order Date].[Year])-1
))
Result is as below.
Or you can build a calendar table and relate two tables by date column.
Calendar Table:
Calendar = ADDCOLUMNS(CALENDAR(MIN(Orders2[Order Date]),MAX(Orders2[Order Date])),"Year",YEAR([Date]))
Then build a measure as below.
2.PP1 = CALCULATE(SUM('Orders2'[Sales]),DATEADD('Calendar'[Date],-1,YEAR))
Result is as below.
You can download the pbix file from this link: a column specified in the call to function 'dateadd' does not of type date. this is not supported
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.