Forum Discussion

ashaikh's avatar
ashaikh
Helper III
8 years ago
Solved

SLA calculation

Hello Guys,

 

I have a scenario here;

I need to calulate SLA percentage based on the Priority.

 

I have 3-columns:

  1. Has Met SLA - Says if it has met SLA
  2. Priority - Priority
  3. Ticket Id - Id of a ticket.

Now SLA is calulated as count of ticket for which priority a has met divided by total count of ticket for that priority

 

Example

 

For Priority: Low

Total Tickets: 100

Has Met SLA : 95

Has not met SLA: 5

SLA Percentage: 95%

 

I need help with DAX calculation how will i get the SLA percentage.

  • fhill's avatar
    fhill
    8 years ago

    Tickets = COUNT(Table1[Ticket ID])

    SLA%_2 = COUNT(Table1[SLA_Check - Text]) / CALCULATE(COUNT(Table1[SLA_Check - Text]), ALL(Table1[SLA_Check - Text]))

     

9 Replies

  • fhill's avatar
    fhill
    Resident Rockstar

    Is your Has Met SLA YES/NO (text) or 0/1 (bit)?

      • fhill's avatar
        fhill
        Resident Rockstar

        Hope this helps...

         

        Measures:

        Tickets = COUNT(Table1[Ticket ID])  // ALL Tickets (In a Table, Power BI automatically groups by values (i.e. Priority)

         

        Pass_SLA = CALCULATE(COUNT(Table1[SLA_Check - Text]), // Counts # of Tickets
                               Table1[SLA_Check - Text] = "YES") // Filtering for only "YES"

         

        SLA% = [Pass_SLA] / CALCULATE(COUNT(Table1[SLA_Check - Text]), ALL(Table1[SLA_Check - Text]))

             // The ALL brings back in ALL values, but still maintains the Table Measures (grouping i.e. Priority)