cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gabrielm97
Helper I
Helper I

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.
 
Screenshot_3.png

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.

1 ACCEPTED SOLUTION
lbendlin
Super User III
Super User III

Maybe add another filter

 

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

View solution in original post

1 REPLY 1
lbendlin
Super User III
Super User III

Maybe add another filter

 

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

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.