Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

% of cases met within specific KPI (multiple used)

Hi, this is my first post on the community so apologies if I cause confusion. I've seen that its possible to calculate the % of cases/times in which something meets a KPI, vs doesn't (e.g. hit a KPI 50% of the time). Which presumably then could be shown in a line graph by month?

 

My case is complicated by the fact I am working with multiple KPIs (8 in total - split 4 each across another field). My data is a split of Incidents and Requests, and there are 4 KPI targets for each, which are around the amount of time it takes to resolve a case (ie Resolved Date - Opened Date). I'm trying to work out if there is a way the system can identify which KPI its supposed to be calculating based on. 

 

For example I have a KPI that all low priority incidents need to be resolved by 5 days, but all low priority requests need to be resolved by 20 days ie a different number - similar for medium, high and extremely high priority incidents & requests. Is this doable, or is it something I need to continue doing on Excel?

 

My overall aim is to get a line graph that would enable me to show the worst performing areas by month (ie those that are hitting a filtered KPI the least. 

 

Thanks! I can provide an exerpt of the data if that helps? I'm stumped! 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

I might get shot down here but, in my opinion, if you can do it in Excel, you can do it better in Power BI.

 

You will need to provide an excerpt of your data I think as it's hard to visualise without it.

Make sure you remove any sesitive data please, and make sure to include all the columns that are there. This is how we will identify which KPI we are calculating, assuming that there are columns that state whether the entry is a Request or an Incident etc.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

I might get shot down here but, in my opinion, if you can do it in Excel, you can do it better in Power BI.

 

You will need to provide an excerpt of your data I think as it's hard to visualise without it.

Make sure you remove any sesitive data please, and make sure to include all the columns that are there. This is how we will identify which KPI we are calculating, assuming that there are columns that state whether the entry is a Request or an Incident etc.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

Hello! 

Below I have put 2 tables, the first being the core fields that should enable the reporting to be built, and the 2nd being the relevant KPIs to that data. For context, the fields I would want to be able to filter the data by (in the 1st table below) are 'Priority', 'Task Type' and 'Team'. The dates opened and closed are date/time because some of the KPIs are less than 1 day, as in the 2nd table. 

 

IDPriorityTask TypeTeamOpenedClosed
INC03356434 - LowIncidentService Desk GB02/01/2020 08:1002/01/2020 08:23
INC03356444 - LowIncidentSD Tier 202/01/2020 08:1102/01/2020 08:25
INC03356382 - HighIncidentInfrastructure Team02/01/2020 07:3102/01/2020 08:25
RITM04816044 - LowRequested ItemSD Tier 4 Specialists01/01/2020 01:0002/01/2020 08:55
RITM04817544 - LowRequested ItemService Desk GB02/01/2020 08:5202/01/2020 09:01
INC03356484 - LowIncidentSD Tier 202/01/2020 08:5402/01/2020 09:21
INC03356514 - LowIncidentSD Tier 202/01/2020 09:2102/01/2020 09:54
INC03356584 - LowIncidentService Desk GB02/01/2020 09:4902/01/2020 09:56
INC03356572 - HighIncidentApplications02/01/2020 09:4602/01/2020 09:57
RITM04817954 - LowRequested ItemService Desk GB02/01/2020 10:2302/01/2020 10:24
INC03356561 - CriticalIncidentInfrastructure Team02/01/2020 09:4502/01/2020 10:35
RITM04817961 - CriticalRequested ItemService Desk GB02/01/2020 10:2702/01/2020 11:09
INC03356684 - LowIncidentSD Tier 202/01/2020 11:0402/01/2020 11:32
INC03356704 - LowIncidentSD Tier 202/01/2020 11:3202/01/2020 11:39
RITM04816002 - HighRequested ItemSD Tier 201/01/2020 00:0002/01/2020 11:54
RITM04818174 - LowRequested ItemSD Tier 202/01/2020 12:1102/01/2020 12:37
RITM04818194 - LowRequested ItemInfrastructure Team02/01/2020 12:3302/01/2020 12:46
INC03356794 - LowIncidentApplications02/01/2020 12:2202/01/2020 13:09
RITM04818284 - LowRequested ItemSD Tier 202/01/2020 13:3102/01/2020 13:33
RITM04818294 - LowRequested ItemSD Tier 202/01/2020 13:3502/01/2020 13:39
INC03356804 - LowIncidentSD Tier 202/01/2020 12:2602/01/2020 13:51
RITM04818324 - LowRequested ItemSD Tier 202/01/2020 13:4202/01/2020 14:14
RITM04818094 - LowRequested ItemSD Tier 202/01/2020 11:1902/01/2020 14:15
INC03356814 - LowIncidentService Desk GB02/01/2020 12:3202/01/2020 15:25
RITM04818574 - LowRequested ItemSD Tier 202/01/2020 15:4002/01/2020 15:44
INC03356724 - LowIncidentSD Tier 202/01/2020 11:3602/01/2020 15:46
INC03357004 - LowIncidentSD Tier 202/01/2020 16:1202/01/2020 16:22
INC03356844 - LowIncidentSD Tier 202/01/2020 13:1002/01/2020 16:34
INC03356964 - LowIncidentService Desk GB02/01/2020 15:0302/01/2020 16:40
RITM04818364 - LowRequested ItemGlobal Service Desk02/01/2020 14:1402/01/2020 16:44

 

KPIs below:

Task TypePriorityKPI
Incident4 - Low5 days
Incident2 - High8 hours
Request4 - Low20 days
Request1 - Critical2 days

 

Hope that clarifies things - my aim is to be able to build a filterable line graph showing the 'Team' that is meeting the KPI the least frequently (ie lowest %) across the reported period. 

Hi @Anonymous ,

 

A couple of points:

- I had to edit your example data as there were no KPI failures in the original data

- Some of the [Task Type]/[Priority] pairs had no KPI criteria, so I've just categorised those as 'KPI Met = No'

 

First of all, the data. I added a [kpiMet] column in Power Query to assess each row based on your criteria. Here's the code you can paste into a blank query so you can see the code:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("pZZPb9QwEMW/irXnonr8P77RViqRgEO7t6qHkJoSke4uSRa+PnZgIWM3WRxuq6fqN5M3b8Z9eNiUH68p51IJvrnYCPKGvN//8L/KXd08ud3gf9677ntTO3Lj+q/k9sorlF1SuGSUUUKNBRokPZUY3zxeTNhiln1Dto3rCEupkEhMIio3/i+Yp75rnr9gbLn73FX90B3r4dg5snXVS0TTls8WuCu3H6gwoCju+859O7p+cE+kHNzLpHtB7g+ubqq26Yc+UOEvFSwN/gCfFpK4kJbnCp0ZgYz9KywFPAKTP4KxK0xlmCohlzoivB1I8oUQdb7XRR8KK4pEkgqz9Wxo3h4ObVNXQ7Pf9SlZBUkgssZDLOR/DBFoWJpEiowJTYCvcN01g2+1zU29/w6ZFOFRGItXquR/jMZ+gd+DAn2Myk1kQIhE4gxRNc2n8lekIroEFMdm9hSwaP3pr/XH9N95P9G95/92Z+I+WXIlvcR1BC+W4WdTE5ghmkxOJYH3Shdzvs+vlaew+JP4KSZ/+mdmnTk8ufBB4hH8jDkL8HiR+Ck0J0tMdhS9HyqhSsAtj2ld1bIIEkx2UliIkkhX+gEWotMb4Pi9NvOPxeIxYemCyvipNnLlCkkr4v30Ej67muUO0h+QcZAGUdHGaJodD2UhlRi+fyb3Xy2fC4gdUJZjB8YnYcXopKXxo6aC4TjQanl0t+3+U9WSaaU0avHDoMYhPv4E", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Priority = _t, #"Task Type" = _t, Team = _t, Opened = _t, Closed = _t]),
    chgAllTypes = Table.TransformColumnTypes(Source,{{"ID", type text}, {"Priority", type text}, {"Task Type", type text}, {"Team", type text}, {"Opened", type datetime}, {"Closed", type datetime}}),
    addDtOpened = Table.AddColumn(chgAllTypes, "dtOpened", each DateTime.Date([Opened]), type date),
    addMthOpened = Table.AddColumn(addDtOpened, "mthOpened", each Text.Combine({Text.Start(Date.MonthName([dtOpened]), 3), Text.Start(Text.From(Date.Year([dtOpened])), 2)}, " "), type text),
    addKpiMet = Table.AddColumn(addMthOpened, "kpiMet", each if [Task Type] = "Incident" and [Priority] = "4 - Low" and Number.From(Duration.From([Closed] - [Opened])) < 5 then "Yes" else
if [Task Type] = "Incident" and [Priority] = "2 - High" and Number.From(Duration.From([Closed] - [Opened])) < 0.333 then "Yes" else
if [Task Type] = "Requested Item" and [Priority] = "4 - Low" and Number.From(Duration.From([Closed] - [Opened])) < 20 then "Yes" else
if [Task Type] = "Requested Item" and [Priority] = "1 - Critical" and Number.From(Duration.From([Closed] - [Opened])) < 2 then "Yes" else "No", type text)
in
    addKpiMet

 

Note that I've added [dtOpened] and [mthOpened] fields to assist with reporting axes. These shouldn't be necessary if you're using a calendar table as is best practice.

 

The percentage KPI met measure is as follows:

_kpiMet% = 
VAR noofReports =
DISTINCTCOUNT(aTable[ID])
VAR kpiMet =
CALCULATE(
    DISTINCTCOUNT(aTable[ID]),
    aTable[kpiMet] = "Yes"
) + 0
RETURN
DIVIDE(kpiMet, noofReports, 0)

 

This gives me the following ouput in line with the limitations noted above:

BA_Pete_0-1611048133369.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Hi @Anonymous ,

 

Thanks for accepting my answer as the solution - I'm glad it did what you needed it to.

 

Could I just ask that you accept the answer with the actual code/measures in as the solution please? This will help others' looking for help in this area to find the actual solution quicker.

 

Thanks,

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.