Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I am trying to think of a function or conditional column that I am able to use for the following situation:
Employee works 2/16 at 11:00pm (CST) and clocks in at 11:01:29 PM equals late because he didn't clock in at the schedule time.
But, because employee works from 11pm-7am, the system reads that employee is schedule at 12am on 2/17 and therefore is late because the clock in shows 12:03:29 AM. It should be counting the 11:01:29 PM clock in as late and not the 12:03:10 AM.
See chart below:
| UserID | Date | Schedule | Login | Late |
| jrex38 | Monday, February 16,2019 | 2/16/2020 11:00:00 PM | 2/16/2020 11:01:29 PM | No |
| jrex38 | Monday, February 17,2019 | 2/17/2020 12:00:00 AM | 2/17/2020 12:03:10 AM | Yes |
Does anyone have any idea what I could to fix this?
Thank you in advance.
Solved! Go to Solution.
In my next book coming out this month, I have a recipe for time zone conversion. Here is a brief excerpt from DAX Cookbook by Packt coming out this month. See if it helps.
To prepare for this recipe, do the following:
| Time | Timezone |
| 1:00:00 PM | EST |
To implement this recipe, do the following:
TZ Convert =
VAR __DestTZ = "ACWST"
VAR __SourceTime = MAX('R09_Table'[Time])
VAR __SourceTZ = MAX('R09_Table'[Timezone])
VAR __SourceOffset =
LOOKUPVALUE(
'R09_Timezones'[DAX UTC Offset],
'R09_Timezones'[Abbr.],
__SourceTZ
)
VAR __DestOffset =
LOOKUPVALUE(
'R09_Timezones'[DAX UTC Offset],
'R09_Timezones'[Abbr.],
__DestTZ
)
VAR __UTCTime = __SourceTime + -1 * __SourceOffset
RETURN
IF(
ISBLANK(__SourceTime),
BLANK(),
__UTCTime + __DestOffset
)
In my next book coming out this month, I have a recipe for time zone conversion. Here is a brief excerpt from DAX Cookbook by Packt coming out this month. See if it helps.
To prepare for this recipe, do the following:
| Time | Timezone |
| 1:00:00 PM | EST |
To implement this recipe, do the following:
TZ Convert =
VAR __DestTZ = "ACWST"
VAR __SourceTime = MAX('R09_Table'[Time])
VAR __SourceTZ = MAX('R09_Table'[Timezone])
VAR __SourceOffset =
LOOKUPVALUE(
'R09_Timezones'[DAX UTC Offset],
'R09_Timezones'[Abbr.],
__SourceTZ
)
VAR __DestOffset =
LOOKUPVALUE(
'R09_Timezones'[DAX UTC Offset],
'R09_Timezones'[Abbr.],
__DestTZ
)
VAR __UTCTime = __SourceTime + -1 * __SourceOffset
RETURN
IF(
ISBLANK(__SourceTime),
BLANK(),
__UTCTime + __DestOffset
)
Apologies @Anonymous , it is out there now! 🙂
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |