Forum Discussion
Return datetime value based on value in another column
- 4 years ago
Hi macmy034 ,
Is this what you want?
Calculated StartTime = [Shift Start Time]+#duration(0, 0, 0,[StartCalc])Calculated EndTime = [Shift End Time]-#duration(0, 0, 0,[EndCalc])Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Sorry Yes, I have several people - and its over several different days too;
So im guessing I also need a
Var Person = SELECTEDVALUE(table[person]))
Var Date = SELECTEDVALUE(table[date]))
then how do I add that into my calculate?
Can you post sample data as text and expected output?
Not enough information to go on;
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
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables
Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/
- macmy0344 years ago
Resolver I
Sorry guys; I figured it may be easier if I simplified it but I think that made it more complicated haha.
ShiftIndex is Date + 1 for D/S / 2 for N/S
Duration is time a person was in this status
SAP_ID is the Person
StartCalc is Shift Start time minus StartTime (time from shift start time in seconds)
EndCalc is the same, but minus Shift End time.
I need to find the status start time that is closest to the shift start time (smallest amount of start calc) then I need to find the end time closest to the shift end time (Smallest amount of endcalc)
Also: Since taking this screenshot i've found the cause of the duplicates and removed it too 🙂
- Icey4 years ago
Community Support
Hi macmy034 ,
Is this what you want?
Calculated StartTime = [Shift Start Time]+#duration(0, 0, 0,[StartCalc])Calculated EndTime = [Shift End Time]-#duration(0, 0, 0,[EndCalc])Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.