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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Dynamic SUM Calculation using "Not Selected" Values and Percentile boundaries

I have a data set in the attached format with over 22,000 rows

 

WorkOrderNumberPartNumberEmployeeFullNameWorkOrderQuantityClockedHoursClockedHoursPerUnitPercentWorkPerformanceWorkOrderActualHoursActPerUnitWorkOrderEstHoursEstPerUnitWcPerformanceWOPerformanceWOActualHoursWOEstHours
1201943490Amber Johnson10.770.770.1224160.6197076.296.2910.1510.150.6197040.7456790129.0612.15
1211943490Amber Johnson12.822.820.2215231.25419212.7312.7310.1510.151.2541871.34156378616.312.15
1221943490Amber Johnson18.38.30.6331041.29162613.1113.1110.1510.151.2916251.71851851920.8812.15
1231943490Nicole Walker10.60.60.0448091.31922913.3913.3910.1510.151.3192111.34403292216.3312.15
1241943490Nicole Walker12.052.050.1382331.46108614.8314.8310.1510.151.4610831.50864197518.3312.15
1251850981Carolyn Stephens13.753.750.7425740.4975375.055.0510.1510.150.4975360.662551448.0512.15
1261850981Carolyn Stephens14.254.250.6756750.6197056.296.2910.1510.150.6197040.7456790129.0612.15
1271850981Carolyn Stephens14.514.510.6452070.688676.996.9910.1510.150.6886690.8181069969.9412.15
1281850981Carolyn Stephens11.911.910.2255010.8344858.478.4710.1510.150.8344820.88312757210.7312.15
1291850981Jennifer Santos18.458.450.7491131.1113311.2811.2810.1510.151.111331.51769547318.4412.15
1301850981Jennifer Santos12.092.090.1734431.18719912.0512.0510.1510.151.1871921.39506172816.9512.15
1311850981Jennifer Santos17.237.230.5945721.1980312.1612.1610.1510.151.1980291.19506172814.5212.15
1321850981Nicole Walker10.50.50.0375091.31331413.3313.3310.1510.151.31331.61810699619.6612.15
1331850981Nicole Walker13.793.790.2830471.31921213.3913.3910.1510.151.3192111.34403292216.3312.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: 

 

Q-Table.png

 

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.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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