Returns the latest Fact, chronologically, in a metric or KPI FactList that lands on the specified date. 

var list = kpis.get('Total AWS Cost');
var start = list.valueFor(now.startOfWeek());
var current = list.valueFor(now);

// the cost difference this week, defaults set to zero
return current.value(0) - start.value(0);

This function does not consider the time of day and always returns the latest available Fact on the day. Consider the following example which returns the latest value for a metric on the date of the KPI calculation:

var list = metrics.get('Unresolved Issues');

return list.valueFor(now);

This is equivalent to:

return metrics.get('Unresolved Issues').getLatest();

Which can be shortened to:

return metrics.getLatest('Unresolved Issues');
Did this answer your question?