The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a data set in the attached format with over 22,000 rows
WorkOrderNumber | PartNumber | EmployeeFullName | WorkOrderQuantity | ClockedHours | ClockedHoursPerUnit | PercentWork | Performance | WorkOrderActualHours | ActPerUnit | WorkOrderEstHours | EstPerUnit | WcPerformance | WOPerformance | WOActualHours | WOEstHours |
120 | 1943490 | Amber Johnson | 1 | 0.77 | 0.77 | 0.122416 | 0.619707 | 6.29 | 6.29 | 10.15 | 10.15 | 0.619704 | 0.745679012 | 9.06 | 12.15 |
121 | 1943490 | Amber Johnson | 1 | 2.82 | 2.82 | 0.221523 | 1.254192 | 12.73 | 12.73 | 10.15 | 10.15 | 1.254187 | 1.341563786 | 16.3 | 12.15 |
122 | 1943490 | Amber Johnson | 1 | 8.3 | 8.3 | 0.633104 | 1.291626 | 13.11 | 13.11 | 10.15 | 10.15 | 1.291625 | 1.718518519 | 20.88 | 12.15 |
123 | 1943490 | Nicole Walker | 1 | 0.6 | 0.6 | 0.044809 | 1.319229 | 13.39 | 13.39 | 10.15 | 10.15 | 1.319211 | 1.344032922 | 16.33 | 12.15 |
124 | 1943490 | Nicole Walker | 1 | 2.05 | 2.05 | 0.138233 | 1.461086 | 14.83 | 14.83 | 10.15 | 10.15 | 1.461083 | 1.508641975 | 18.33 | 12.15 |
125 | 1850981 | Carolyn Stephens | 1 | 3.75 | 3.75 | 0.742574 | 0.497537 | 5.05 | 5.05 | 10.15 | 10.15 | 0.497536 | 0.66255144 | 8.05 | 12.15 |
126 | 1850981 | Carolyn Stephens | 1 | 4.25 | 4.25 | 0.675675 | 0.619705 | 6.29 | 6.29 | 10.15 | 10.15 | 0.619704 | 0.745679012 | 9.06 | 12.15 |
127 | 1850981 | Carolyn Stephens | 1 | 4.51 | 4.51 | 0.645207 | 0.68867 | 6.99 | 6.99 | 10.15 | 10.15 | 0.688669 | 0.818106996 | 9.94 | 12.15 |
128 | 1850981 | Carolyn Stephens | 1 | 1.91 | 1.91 | 0.225501 | 0.834485 | 8.47 | 8.47 | 10.15 | 10.15 | 0.834482 | 0.883127572 | 10.73 | 12.15 |
129 | 1850981 | Jennifer Santos | 1 | 8.45 | 8.45 | 0.749113 | 1.11133 | 11.28 | 11.28 | 10.15 | 10.15 | 1.11133 | 1.517695473 | 18.44 | 12.15 |
130 | 1850981 | Jennifer Santos | 1 | 2.09 | 2.09 | 0.173443 | 1.187199 | 12.05 | 12.05 | 10.15 | 10.15 | 1.187192 | 1.395061728 | 16.95 | 12.15 |
131 | 1850981 | Jennifer Santos | 1 | 7.23 | 7.23 | 0.594572 | 1.19803 | 12.16 | 12.16 | 10.15 | 10.15 | 1.198029 | 1.195061728 | 14.52 | 12.15 |
132 | 1850981 | Nicole Walker | 1 | 0.5 | 0.5 | 0.037509 | 1.313314 | 13.33 | 13.33 | 10.15 | 10.15 | 1.3133 | 1.618106996 | 19.66 | 12.15 |
133 | 1850981 | Nicole Walker | 1 | 3.79 | 3.79 | 0.283047 | 1.319212 | 13.39 | 13.39 | 10.15 | 10.15 | 1.319211 | 1.344032922 | 16.33 | 12.15 |
The goal is to have a dynamic scorecard that changes when an employee is selected. The scorecard will have a list of work orders completed by that employee displayed with a few more calculations. like below:
One of the calculations is the total quantity produced by the employee's peers (PN Quantity), per part number as below:
However, the caveat is that some of the peer rows are outliers based on the WCPerformance column. So in calculating the Peer Quantities we are to remove those outliers.
I attempted to use the IQR to remove the outliers, but I keep getting an error for not enough memory.
Peer Total PN =
VAR
LowerQuartile =
PERCENTILEX.INC (
FILTER(
ALLEXCEPT('fact Work Order Details','fact Work Order Details'[PartNumber]),
'fact Work Order Details'[EmployeeFullName] <> SELECTEDVALUE('fact Work Order Details'[EmployeeFullName])) ,
[Peer Average Performance],
0.25 )
VAR
UpperQuartile =
PERCENTILEX.INC (
FILTER(
ALLEXCEPT('fact Work Order Details','fact Work Order Details'[PartNumber]),
'fact Work Order Details'[EmployeeFullName] <> SELECTEDVALUE('fact Work Order Details'[EmployeeFullName])) ,
[Peer Average Performance],
0.75 )
VAR
IQR = UpperQuartile - LowerQuartile
VAR LowerBound = LowerQuartile - (IQR * 1.5)
VAR UpperBound = UpperQuartile - (IQR * 1.5)
RETURN
CALCULATE(
[Total Quantity],
FILTER(
'fact Work Order Details',
AND('fact Work Order Details'[WCPerformance] >= LowerBound, 'fact Work Order Details'[WCPerformance] <= UpperBound)
)
)
Not sure what I am getting or understanding wrong.
Solved! Go to Solution.
Unfortunately, I was not able to resolve the issue. I decided to calculate a static IQR partitioned by the part number in SQL and created a filter to identify the rows that are within the limits of the dataset by P/N. Then I used this as a filter in a measure in addition to the not selectedvalues and P/N filters.
Unfortunately, I was not able to resolve the issue. I decided to calculate a static IQR partitioned by the part number in SQL and created a filter to identify the rows that are within the limits of the dataset by P/N. Then I used this as a filter in a measure in addition to the not selectedvalues and P/N filters.
User | Count |
---|---|
78 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
104 | |
93 | |
52 | |
50 | |
46 |