Forum Discussion
mapr
3 years agoFrequent Visitor
Show sum previous month and specific month
Hi everybody, I have been missing for a some time. I need a card that shows the units of the previous month or a specific month, the date field may contain duplicate records from what I understan...
- 3 years ago
Ok, DATEADD is not ok, I need to use another formula to calculate this.
Finally, I have solved with this formula:
Penalizacion_Mes_Previo_VF = VAR _year = IF(MONTH(NOW())=1,YEAR(NOW())-1,YEAR(NOW()))ReturnCALCULATE(SUM(table[Uds]),AND(MONTH(table[date])=MONTH(NOW())-1,YEAR(table[date])= _year))
mapr
3 years agoFrequent Visitor
Ok, DATEADD is not ok, I need to use another formula to calculate this.
Finally, I have solved with this formula:
Penalizacion_Mes_Previo_VF = VAR _year = IF(MONTH(NOW())=1,YEAR(NOW())-1,YEAR(NOW()))
Return
CALCULATE(SUM(table[Uds]),AND(MONTH(table[date])=MONTH(NOW())-1,YEAR(table[date])= _year))