Forum Discussion
Function 'DATEADD' only works with contiguous date selections.
Hi All,
I have this error which is a measure calculated from net sales DATEADD -1 year.
MdxScript(Model) (1, 134) Calculation error in measure 'DimDate'[P/Y Sales1]: Function 'DATEADD' only works with contiguous date selections.
Unsure how i get over this so any help really appreciated.
Thanks
Craig
CraigBlackmanYou can try P/Y Sales = CALCULATE ( [Net Sales]; SAMEPERIODLASTYEAR( Dates[Date]))
or wrap your P/Y Sales with SUMX
P/Y Sales = SUMX ( salestable; calculate( [Net Sales]; DATEADD( Dates[Date]; -1 ; Year ))
9 Replies
- konstantinosMemorable MemberThe problem usually is the Grand total or a graph which has more year values...you can wrap the formula IF(HASONEVALUE(Dates[Year]); yourmeasure)
http://www.powerpivotpro.com/2014/01/defanging-the-contiguous-date-selections-error/- CraigBlackmanHelper III
Hi,
Thanks for that. The issue is that I want to display a total for these columns.
I have this table, the P/Y Sales and P/Y Orders a\re the problem columns here, both based on the current date -1 Year.
Maybe I can calacultae this in another fashion?
- konstantinosMemorable Member
CraigBlackmanYou can try P/Y Sales = CALCULATE ( [Net Sales]; SAMEPERIODLASTYEAR( Dates[Date]))
or wrap your P/Y Sales with SUMX
P/Y Sales = SUMX ( salestable; calculate( [Net Sales]; DATEADD( Dates[Date]; -1 ; Year ))