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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

challenge for dax gurus

Hi Dax and math gurus.

 

 

Overtid 2 test =
var __dailyReduction = 0,5
var __dailyThreshold = 9,5
var __result2 =

SUMX(
UNION(
FILTER(
SUMMARIZE(
powtime;
powtime[date_start];
Kalender[Day of Week];
labour[labour_name];
"Value";
var __baseHours = [timer tot]
var __shouldApplyReduction = __baseHours > __dailyThreshold
var __reduction = __dailyReduction * __shouldApplyReduction
var __legalWorktimeReduction = 7,5
return
__baseHours - __reduction - __legalWorktimeReduction
);
[Value] >= 0 && Kalender[Day of Week] <> 6 && Kalender[Day of Week] <> 7
);
FILTER(
SUMMARIZE(
powtime;
powtime[date_start];
Kalender[Day of Week];
labour[labour_name];
"Value";
var __baseHours = [timer tot]
return
__baseHours
);
[Value] >= 0 && OR(Kalender[Day of Week] = 6; Kalender[Day of Week] = 7))
);
[Value]
)

return

__result2


....................................

Im in dire need to get this done but i cant figure out how to get the results i want as i am only starting to learn DAX.

the calculation cannot be altered too much either because i need the sum to be on the right side in the matrix as is.
 
All help is appreciated
Skjermbilde22.JPG
I need __result2 to be; 
 
Up until 37,5 hours per week where work per 24 hours does not exceed 9 hours, overtime is everything above 9 hours.
 
And
 
Where hours exceed 37,5 hours per week up until 40 hours a week overtime is everything above 7,5 hours. 

this calculation does also need to include whatever is in the Dax from before. like everything worked Sunday is overtime and friday-saturday is above either 7,5 or 9 hours.

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

Going to be very difficult without sample data posted as a table (text) and expected output from that sample data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



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

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

Going to be very difficult without sample data posted as a table (text) and expected output from that sample data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.