Forum Discussion

nbarta's avatar
nbarta
Frequent Visitor
5 years ago
Solved

Filtering by Department as a whole

PersonIDDepartmentOvertimeRegularOT % (OT / (OT +REG)) 
1Produce51033%
2Produce1204.7%
3Dairy31023%
4Dairy52020%
5Produce101050%
6Liquor202050%

 

Here is an example of the dataset I'm working with. I have a chart that shows Department by Overtime Percentage. I want to show departments that have a total over time percentage of above 25%. When I put a filter to look for OT% > 25% then it removes each individual that does not meet the requirement instead of filtering based on the department, which is what I want to do. So for Produce Department, their total OT Percent is calculated as 29% [ (33 + 4.7 + 50)/3 ]  But with the filter I would lose the 4.7% row. 

 

I've looked through a few posts that were similar but nothing I've tried so far is working correctly 

 

  • Hi,

    Try adding a new measure:

    OT % (Department) =
    CALCULATE (
        DIVIDE (
            SUM ( MyTable[Overtime] ),
            SUM ( MyTable[Overtime] ) + SUM ( MyTable[Regular] )
        ),
        ALLEXCEPT ( MyTable, MyTable[Department] )
    )

    and using that in the Filters pane instead.

    Regards

1 Reply

  • Hi,

    Try adding a new measure:

    OT % (Department) =
    CALCULATE (
        DIVIDE (
            SUM ( MyTable[Overtime] ),
            SUM ( MyTable[Overtime] ) + SUM ( MyTable[Regular] )
        ),
        ALLEXCEPT ( MyTable, MyTable[Department] )
    )

    and using that in the Filters pane instead.

    Regards