Forum Discussion
PatriceGREN
7 years agoRegular Visitor
Using Dateadd
Hi, I can t use the DATEADD function correctly. DATEADD(HISTORIQUE[DateFinPeriodeEssai1],-nbjprevenance,DAY) -nbjprevenance = variable if I put 0 in place of the variable, I get the right dates...
- 7 years ago
Hi,
After many tests, I tried this syntax:
HISTORIQUE[DateFinPeriodeEssai1] - nbjprevenance
and it works.
parry2k
Super User
7 years agoPatriceGRENcan you provide details on how you are calculating nbjprevenance variable? Also do you have date dimension in your model on which you are performing this DateADD function?
PatriceGREN
7 years agoRegular Visitor
Hi,
datePrevenancePeriodeEssai1 =
var nbj = HISTORIQUE[NombreJourDebutContrataDateJour]
var nbjprevenance =
switch(TRUE(); -- donne le nombre de jours de prévenance à respecter
nbj <8 ; 1;
and(nbj > 8 ; nbj <= 30);2;
and(nbj >30 ; nbj <= 90);15;30 )
return
DATEADD(HISTORIQUE[DateFinPeriodeEssai1];-nbjprevenance;DAY)
for the "Date Dimension", I'll look. This is a model that is available to me, I don't know yet everything in it.