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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Vitaliy
Helper I
Helper I

Calculate Overtime

Hi all!

 

I have a data model ( you can download pbix file here)
Screenshot_2.png

 

i want to build a report with table like this one below:

Screenshot_3.png

 

But my Overtime field and Overtime card KPI in total values is not fully correct, they are Blank.
How I calculate:

LogHours_forPeriod = 
CALCULATE(
    [LogHours];
    USERELATIONSHIP(worklogs[date_only];DateTime_Vacations[Date])
)
PlannedHours_forMonth = SUMx(VALUES(worklogs[username]);CALCULATE(sum(planned_hours[Working hours])))
Overtime help measure = worklogs[LogHours_forPeriod]-planned_hours[PlannedHours_forMonth]

 

And Overtime:

Overtime = SUMX(FILTER(SUMMARIZE('worklogs';worklogs[username];"ABCD";[Overtime help measure]);[Overtime help measure]>0);[Overtime help measure])

but I want to show in Total row of the Overtime field value = 32 (sum of positive values for every month and user), now this cell is blank (Overtime KPI card Blank too)
What's wrong in my "Overtime" measure?
Please, help!

 

Thanks.

1 ACCEPTED SOLUTION

Hi @Vitaliy ,

After play with your sample, I found your overtime measure contians filter on 'overtime help' measure if its result less than zero. 

Overtime = SUMX(FILTER(SUMMARIZE('worklogs',worklogs[username],"ABCD",[Overtime help measure]),[Overtime help measure]>0),[Overtime help measure])

13.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @Vitaliy ,

I can't view your sample file, it seems like you haven't shared it correctly.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@v-shex-msft  sorry, link was updated

Hi @Vitaliy ,

After play with your sample, I found your overtime measure contians filter on 'overtime help' measure if its result less than zero. 

Overtime = SUMX(FILTER(SUMMARIZE('worklogs',worklogs[username],"ABCD",[Overtime help measure]),[Overtime help measure]>0),[Overtime help measure])

13.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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