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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Justas4478
Post Prodigy
Post Prodigy

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
Justas4478_0-1701260294100.png 

This is what I hoped it would show

Justas4478_1-1701260410433.png

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

Justas4478_2-1701260462098.png

Does anyone know what I did wrong in the measure?

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
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.
 
amitchandak
Super User
Super User

@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])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors