Forum Discussion
CraigBlackman
10 years agoHelper III
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 w...
- 10 years ago
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 ))
konstantinos
10 years agoMemorable 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 ))
cynSupersonic
7 years agoNew Member
I have tried to make the formula to calculate the variation of a measure:
PYTDInversionTotal = SUMX (Fact_Market; CALCULATE ([Total Investment]; DATEADD (Dim_EmissionAmission Notice [TimeKey]; - 1; YEAR)))
But when I take it to my model it does not calculate me any value. What could be the problem?