Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Last Nonzero Value

I created a measure to know my ability
 
Capacity (Mean) = SUM('Produção'[Production)/SUM('Produção'[Hours])
 
Right after I made a calculation to always return the last value of the filtered month.
 
Last Capacity = CALCULATE( [Capacity (Mean)], FILTER('Produção','Produção'[Date]=MAX([Date])))
 
However I want a way to return the last value of the month that is not zero.
 

Note, currently it returns the value 0 of the last day of the month but I would like it to return the value 937 which was the last to be produced.

 

I looked for other publications with this same problem but no solution solved for me.

  • Maybe add another filter

     

    Last Capacity = CALCULATE( [Capacity (Mean)], 'Produção'[Date]=MAX([Date]), [Capacity (Mean)]>0 )

1 Reply

  • Maybe add another filter

     

    Last Capacity = CALCULATE( [Capacity (Mean)], 'Produção'[Date]=MAX([Date]), [Capacity (Mean)]>0 )