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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rmeng
Helper II
Helper II

Fixing total Measure Time off

I have a table GLBL_TIMEOFF_TERRITORY:
 
rmeng_0-1689358577576.png

I need 2 measures: 

# Time Off = SUM(GLBL_TIMEOFF_TERRITORY[TOT_HOURS]) -- this is easy

# Working Time =
 8-
SUMX(
    SUMMARIZE(
        GLBL_TIMEOFF_TERRITORY,
        GLBL_TIMEOFF_TERRITORY[COUNTRY],
        GLBL_TIMEOFF_TERRITORY[TERR_TA],
        GLBL_TIMEOFF_TERRITORY[TOT_TERRITORY],
        GLBL_TIMEOFF_TERRITORY[TOT_DATE],
        GLBL_TIMEOFF_TERRITORY[TOT_HOURS]
    ),
    [# Time Off]
)
It´s working well in the row context but not in filter context
The problem is the total = -34 should be 14. 
Could you help me to fix this measure

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@rmeng First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

rmeng
Helper II
Helper II

I got it thanks.

# Work hours = 
SUMX(
    SUMMARIZE (
        GLBL_TIMEOFF_TERRITORY,
        GLBL_TIMEOFF_TERRITORY[TOT_DATE]
    ),
    MAX(GLBL_TIMEOFF_TERRITORY[Work Hours])
)

View solution in original post

3 REPLIES 3
rmeng
Helper II
Helper II

I got it thanks.

# Work hours = 
SUMX(
    SUMMARIZE (
        GLBL_TIMEOFF_TERRITORY,
        GLBL_TIMEOFF_TERRITORY[TOT_DATE]
    ),
    MAX(GLBL_TIMEOFF_TERRITORY[Work Hours])
)
Anonymous
Not applicable

Hi @rmeng ,

Why you say the Total for "# Working Time" should be 14, for "# Working Time" measue in the table visual will return the same value with "# Time Off " measure, the Total value will be "8-40=-32".

According to your dax formual, there is correct.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Community Champion
Community Champion

@rmeng First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.