Forum Discussion

Justas4478's avatar
Justas4478
Post Prodigy
2 years ago
Solved

Filtering measures with slicers

Hi, I have this measure: 

Hours for Absence =
CALCULATE(
    SUM('System Work Hours'[Hours Total]),
    'System Data'[Absence] IN {
        "Authorised Absence",
        "Bank Holiday",
        "Holiday",
        "Maternity/Paternity",
        "Sickness",
        "Unauthorised"
    }
)
And it it is working fine, but when I am using slicer it does not filter hours and just shows total for all of categories.
This is what I see
 

This is what I hoped it would show

And this is how I expect to act when slicer is selected

Does anyone know what I did wrong in the measure?

Thanks

  • Justas4478 , I really do not know you need filter in this case. But trylike

     

    Hours for Absence =
    CALCULATE(
    SUM('System Work Hours'[Hours Total]),
    Filter( 'System Data', 'System Data'[Absence] IN {
    "Authorised Absence",
    "Bank Holiday",
    "Holiday",
    "Maternity/Paternity",
    "Sickness",
    "Unauthorised"
    }
    ))

     

    if it works - Difference in filtering data in CALCULATE with and without FILTER? - https://youtu.be/KDcmzwgPvXQ

     

    Ideally this should work

    SUM('System Work Hours'[Hours Total])

     

     

2 Replies

  • Justas4478 , I really do not know you need filter in this case. But trylike

     

    Hours for Absence =
    CALCULATE(
    SUM('System Work Hours'[Hours Total]),
    Filter( 'System Data', 'System Data'[Absence] IN {
    "Authorised Absence",
    "Bank Holiday",
    "Holiday",
    "Maternity/Paternity",
    "Sickness",
    "Unauthorised"
    }
    ))

     

    if it works - Difference in filtering data in CALCULATE with and without FILTER? - https://youtu.be/KDcmzwgPvXQ

     

    Ideally this should work

    SUM('System Work Hours'[Hours Total])

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    You do not need the filter in the Calculation. The table will work if you just use:

    Hours for Absence = SUM('System Work Hours'[Hours Total])

    The slicer will filter the table just fine for this.