Forum Discussion
MTBF implementation for Service Now
- Anonymous7 years ago
Hi,
In my case the above solution did not work.I tried with another solution.
I created a Row count column as below which groupe the data based upon the Assignment group and priority and gives the count of this .
Row_counts = CALCULATE(COUNTROWS('INC Overview'),ALLEXCEPT('INC Overview','INC Overview'[Priority],'INC Overview'[Assignment group]))
then I created another column let say Avg_MTBF which calculated the time between two failure of incidences and also cover those cases where we recieved only one incidence (in that case it will give the difference between today date and the day when it was occurred.)
Avg_MTBF = If(([Row_counts]>1 && [2nd_highestvalue] <>BLANK()), DateDiff([2nd_highestvalue],[Created],DAY),
IF([Row_counts]=1 && [2nd_highestvalue] =BLANK(),ABS(DateDiff(TODAY(),[Created],DAY)),0))
MTBFCount = VAR CompareDate = IF([2nd_highestvalue],max([2nd_highestvalue]),TODAY()) RETURN
If((MAX([Created]) && max([Priority])="1 - Critical" ||Max([Priority])="2 - High" ), DateDiff(CompareDate,MAX([Created]),DAY),0)
- Anonymous7 years agoNot applicable
Hi,
Really thanks for your prompt help.
However when I am using this as a cal measure then its giving me the below errorcalc_measure errorand when I am trying to create a calc column then it is calculating all the values zero;which make no sense to me.
Please can you suggest what could be the best way to handle this.
- Seward125337 years agoSolution SageSorry Saines your second highest measure returned a distinct value. Just wrap the test for the second highest value in a max or any other aggregate function in both the terms of the VAR MAX([2nd_highestvalue]),
The reason it didn’t work as a calc column is that the filter context is limited to that row unless you use EARLIER or something to expand it so there is never a second higher at value for a single row.