Skip to content

Instantly share code, notes, and snippets.

@cbaragao
Created October 3, 2025 02:00
Show Gist options
  • Select an option

  • Save cbaragao/d3697576e45a7010d2de69dc568dcb3a to your computer and use it in GitHub Desktop.

Select an option

Save cbaragao/d3697576e45a7010d2de69dc568dcb3a to your computer and use it in GitHub Desktop.
Cpl =
/*
=============EXAMPLE DATASET===================
CallID Duration_Minutes Agent Date
C1001 4.2 Agent_A 2024-01-15
C1002 3.5 Agent_B 2024-01-15
C1003 2.8 Agent_C 2024-01-15
C1004 4.6 Agent_A 2024-01-15
C1005 3.9 Agent_B 2024-01-16
C1006 3.2 Agent_C 2024-01-16
C1007 2.5 Agent_A 2024-01-16
C1008 4.1 Agent_B 2024-01-16
C1009 3.7 Agent_C 2024-01-17
C1010 3.4 Agent_A 2024-01-17
C1011 4.3 Agent_B 2024-01-17
C1012 2.9 Agent_C 2024-01-17
C1013 3.8 Agent_A 2024-01-18
C1014 3.1 Agent_B 2024-01-18
C1015 2.7 Agent_C 2024-01-18
C1016 4.5 Agent_A 2024-01-18
C1017 3.6 Agent_B 2024-01-19
C1018 3.3 Agent_C 2024-01-19
C1019 4.0 Agent_A 2024-01-19
C1020 2.6 Agent_B 2024-01-19
C1021 3.9 Agent_C 2024-01-22
C1022 3.5 Agent_A 2024-01-22
C1023 4.2 Agent_B 2024-01-22
C1024 3.0 Agent_C 2024-01-22
C1025 3.7 Agent_A 2024-01-23
C1026 2.9 Agent_B 2024-01-23
C1027 4.4 Agent_C 2024-01-23
C1028 3.2 Agent_A 2024-01-23
C1029 3.8 Agent_B 2024-01-24
C1030 3.4 Agent_C 2024-01-24
C1031 2.8 Agent_A 2024-01-24
C1032 4.1 Agent_B 2024-01-24
C1033 3.6 Agent_C 2024-01-25
C1034 3.3 Agent_A 2024-01-25
C1035 4.7 Agent_B 2024-01-25
C1036 2.7 Agent_C 2024-01-25
C1037 3.9 Agent_A 2024-01-26
C1038 3.5 Agent_B 2024-01-26
C1039 4.2 Agent_C 2024-01-26
C1040 3.1 Agent_A 2024-01-26
*/
// Define lower specification limit
VAR __LSL = 3
// Calculate process center and spread
VAR __Mean = AVERAGE('Call Center'[Duration_Minutes])
VAR __STDEV = STDEV.S('Call Center'[Duration_Minutes])
// Calculate capability: distance to spec limit divided by natural process spread
// Uses 3-sigma (99.73% of normal distribution) as the spread measure
VAR __Lower_Distance = DIVIDE((__Mean - __LSL), (3*__STDEV), BLANK()) // Capability relative to LSL
RETURN __STDEV
// Result interpretation:
// Cpu = (Room to Limit) / (Process Spread)
// Values < 1.0 indicate the process naturally exceeds the specification limit
// To improve: reduce mean, reduce variation, or both
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment