Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi All,
I am stuck in a situation where I have service Now (SNOW) data for P1,P2 and want to calculate MTBF based upon the assignment group.But confused about the situation when we have only one incidence for a particular assignment group.I want to calculate the days ;if there is no other incidence then it should give the difference of today date and creation date.So far I have written this DAX code to calculate this logic.
MTBFCount = If((MAX([Created]) && max([Priority])="1 - Critical" ||Max([Priority])="2 - High" ), DateDiff(MAX([2nd_highestvalue]),MAX([Created]),DAY),0)
2nd_highestvalue = CALCULATE(MAX('INC Overview'[Created]),FILTER('INC Overview', EARLIER('INC Overview'[Priority])='INC Overview'[Priority] && EARLIER('INC Overview'[Created])>'INC Overview'[Created] && EARLIER('INC Overview'[Assignment group])='INC Overview'[Assignment group]))
Note:: I have also using another calculated column '2nd_highestvalue' which is giving me the second latest creation date of that priority incidence and for that assignment group.
'INC Overview' is the table.
So can u please guide me to embed the logic (if there is no other incidence then it should give the difference of today date and creation date)
Also how I can take the average days of that;again classifoication should be the priority and assignment group.
Solved! Go to Solution.
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))
Hi @Anonymous,
Could you please mark the proper answers as solutions?
Best Regards,
Dale
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))
Thank you very much for sharing with the community. @Anonymous
Best Regards,
Dale
Hi,
Really thanks for your prompt help.
However when I am using this as a cal measure then its giving me the below 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.