Forum Discussion
Help with building a measure
I have a measure currently labeled SLA. The data within that measure is either Violated or Non Violated. I need to come up with the % of Non Violated. My brain has since stopped working and I cannot figure out how to get this by building a new measure. Help?
8 Replies
- parry2k
Super User
Anonymous with very little information you provided, try this:
Sales = SUM ( Table[Sales] ) --whatever your measure is I just created sales measure here Percent No violated = DIVIDE ( CALCULATE ( [Sales], Table[Column] = "Non Violated" ), [Sales] )- AnonymousNot applicable
I think maybe I did something wrong?
% Within SLA = SUM((CALCULATE(total_tickets[Tickets Within SLA] = "non Violated")/(CALCULATE(total_tickets[Resolution time in calendar hours % difference from Count of Created date][Tickets Within SLA] = "Violated"))))It says the syntax is wrong, so I'm guessing I did something really wrong. I'm sorry!
- parry2k
Super User
Anonymous not sure what that is but it will be easier if you paste a sample data here with the expected output. I don't know what your calculation should be, just explain the calculation keeping DAX out of the picture.
- AnonymousNot applicable
I've also tried this:
% Within SLA = DIVIDE((CALCULATE(total_tickets[Tickets Within SLA] = "non Violated"),(CALCULATE(total_tickets[Tickets Within SLA]][Tickets Within SLA] = "Violated"))) - AnonymousNot applicable
Sample data below. I have a list of cases and then whether or not they were resolved within the SLA time. For the data below it would be 40% resolved within SLA. (2/5 = 40%) But when I try to do a simple divide it won't work, so I tried a sum but that didn't work either.
Case Resolved within SLA 001 Violated 002 Non Violated 003 Non Violated 004 Non Violated 005 Violated - AnonymousNot applicable
Sorry, 60% would be within SLA, 3/5. I didn't read my own data.
- parry2k
Super User
Anonymous have you read my previous reply?
- parry2k
Super User
Anonymous
Measure Count = COUNTROWS ( Table ) Violated % = DIVIDE ( CALCULATE ( [Measure Count], Table[SLA] = "Violated" ), CALCULATE ( [Measure Count], ALLSELECTED () ) ) Non Violated % = DIVIDE ( CALCULATE ( [Measure Count], Table[SLA] <> "Violated" ), CALCULATE ( [Measure Count], ALLSELECTED () ) ) SLA % = DIVIDE ( [Measure Count], CALCULATE ( [Measure Count], ALLSELECTED () ) )Here are the measures, the 4th one SLA % will work for both the cases if in the table you show SLA column, other measure are dedicated for each SLA type.