Forum Discussion
g-wizard
2 years agoFrequent Visitor
Month to MFG Calc
Hello Team, I have difficulty on converting this calc that is pulling from 2 different tables: IF [X-Plant Material Status]="50" THEN (12-(DATEDIFF('month',[Date from which the X-distr.-chain ma...
- 2 years ago
g-wizard So, in DAX that would be:
SWITCH( [X-Plant Material Status], "50", (12-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY()))), "60", (6-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY()))), "65", (6-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY()))), "70", 0, "75", 0, "80", 0, "85", 0 )
Greg_Deckler
Community Champion
2 years agog-wizard So, in DAX that would be:
SWITCH( [X-Plant Material Status],
"50", (12-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY()))),
"60", (6-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY()))),
"65", (6-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY()))),
"70", 0,
"75", 0,
"80", 0,
"85", 0
)