Forum Discussion
Faber13
4 years agoHelper II
accumulated
Hey guys, I need to calculate the accumulated number of days in which the equipment is stopped, when it is ok it is not to calculate, in this first case it is for the result to be 3, if I filter to another period it is to be 2.
| data | Codigo | Status | ||||
| 22/08/2022 | 6586 | OK | ||||
| 23/08/2022 | 9950 | Parado | ||||
| 24/08/2022 | 6586 | OK | ||||
| 25/08/2022 | 9950 | Parado | ||||
| 26/08/2022 | 6586 | OK | Filter Case 2 | Acumulado CASO 1 | Acumulado CASO 2 | |
| 27/08/2022 | 9950 | OK | 3 | 2 | ||
| 28/08/2022 | 6586 | OK | ||||
| 29/08/2022 | 9950 | Parado | ||||
| 30/08/2022 | 6586 | OK | ||||
| 31/08/2022 | 9950 | Parado | ||||
| 01/09/2022 | 6586 | OK | ||||
| 02/09/2022 | 9950 | Parado | Filter Case 1 |
2 Replies
- v-yadongf-msftCommunity Support
Hi Faber13,
Please try following DAX to create a new column:
Column = VAR cur_today = TODAY() VAR accumulated_days = IF([Status] = "OK",BLANK(),DATEDIFF([date],cur_today,DAY)) RETURN accumulated_daysThen you can calculate the accumulated number of days in which the equipment is stopped:
If I misunderstand your demands, please feel free to contact us in time.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Faber13Helper II
Hi v-yadongf-msft , unfortunately it didn't work my friend, it was to give the results to the below (1,2) (1,2,3,4)