Forum Discussion
Anonymous
6 years agoNot 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.
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
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.
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.
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
1 Reply
- Greg_Deckler
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