Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

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

  • 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]
    )
    
    • Anonymous's avatar
      Anonymous
      Not 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! 
  • 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.

    • Anonymous's avatar
      Anonymous
      Not 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")))
    • Anonymous's avatar
      Anonymous
      Not 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. 

      CaseResolved within SLA
      001Violated
      002Non Violated
      003Non Violated
      004Non Violated
      005Violated
      • Anonymous's avatar
        Anonymous
        Not applicable

        Sorry, 60% would be within SLA, 3/5. I didn't read my own data.

  • 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.