Help with DAX Code

Hi All,

I want to calculate the percentage of tickets resolved within Service Level Agreement. I wrote the following DAX code:
resolved tickets within SLA =
VAR tickets = Count(tickets[ticketID])
VAR allgood = Calculate([resolution])
Return
Calculate(DIVIDE(allgood, tickets,0)

The result is in percentage. Is this code correct? or did I miss any step?

Thank you,
Chuk

Sorry the column [resolution] contains ā€œFalseā€. That is where the resolution is false.

Hi Chuk,

Why are you using variables here, are they necessary? Also, one thing Iā€™ve found is that when Iā€™m grabbing case data, sometimes, depending on the system Iā€™m pulling from, there are multiple listings for ticketID, so Iā€™d do it a little different based on the information youā€™ve given so far.

Measures:

Total Tickets = DISTINCTCOUNT(ā€˜Ticketsā€™[ticketID])
Within SLA = CALCULATE ( COUNT (ā€˜Ticketsā€™ [resolution]), ā€˜Ticketsā€™ [resolution] = ā€œTrueā€)

SLA % = DIVIDE( Within SLA, Total Tickets, 0)

I hope this helps,

mickeydjw

1 Like

Hi @Chukliz, weā€™ve noticed that no response has been received from you since February 04, 2020. We just want to check if you still need further help with this post? In case there wonā€™t be any activity on it in the next few days, weā€™ll be tagging this post as Solved. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box. Thanks!