Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
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
Hello
I need your help.
I need the shift number from Table 2, taking into account the resource, start date, end date, start time, and end time from tables 1 and 2. Table 1 is a notification table of stoppages and breakdowns that we must put on the shift. From Table 2 we take the turn.
| TABLE 1 | |||||||
| RESOURCE | START DATE | END DATE | TEAM | DESCRIPTION OF UNEMPLOYMENT | START TIME | END TIME | NUMERO DE TURNO |
| N02DPuen02 | 08/01/2024 | 08/01/2024 | TOMORROW | Stoppage due to Material Accumulation | 6:22:29 | 7:44:47 | |
| N02DPuen02 | 08/01/2024 | 08/01/2024 | LATE | Stoppage due to Material Accumulation | 15:00:23 | 16:00:25 | |
| N02DPuen02 | 08/01/2024 | 09/01/2024 | NIGHT | Stoppage due to Material Accumulation | 23:00:00 | 0:32:00 | |
| N44PulTB02 | 08/01/2024 | 08/01/2024 | TOMORROW | Stoppage due to Material Accumulation | 7:00:25 | 7:44:47 | |
| N44PulTB02 | 08/01/2024 | 08/01/2024 | LATE | Stoppage due to Material Accumulation | 19:00:21 | 21:25:25 | |
| N44PulTB02 | 08/01/2024 | 09/01/2024 | NIGHT | Stoppage due to Material Accumulation | 23:00:00 | 1:25:36 | |
| TABLE 2 | |||||||
| NUMERO DE TURNO | RESOURCE | START DATE | END DATE | START TIME | END TIME | TEAM | |
| 024-0000001 | N02DPuen02 | 08/01/2024 | 08/01/2024 | 6:00:00 | 14:00:00 | TOMORROW | |
| 024-0000025 | N02DPuen02 | 08/01/2024 | 08/01/2024 | 14:00:00 | 22:00:00 | LATE | |
| 024-0000032 | N02DPuen02 | 08/01/2024 | 09/01/2024 | 22:00:00 | 6:00:00 | NIGHT | |
| 024-0000002 | N44PulTB02 | 08/01/2024 | 08/01/2024 | 6:00:00 | 14:00:00 | TOMORROW | |
| 024-0000065 | N44PulTB02 | 08/01/2024 | 08/01/2024 | 14:00:00 | 22:00:00 | LATE | |
| 024-000098 | N44PulTB02 | 08/01/2024 | 09/01/2024 | 22:00:00 | 6:00:00 | NIGHT |
Solved! Go to Solution.
Try this calculated column in Table1:
NUMERO DE TURNO =
VAR vResource = Table1[RESOURCE]
VAR vStartDate = Table1[START DATE]
VAR vEndDate = Table1[END DATE]
VAR vTeam = Table1[TEAM]
VAR vTable2 =
FILTER (
Table2,
Table2[RESOURCE] = vResource
&& Table2[START DATE] = vStartDate
&& Table2[END DATE] = vEndDate
&& Table2[TEAM] = vTeam
)
VAR vResult =
MAXX ( vTable2, Table2[NUMERO DE TURNO] )
RETURN
vResult
Proud to be a Super User!
Try this calculated column in Table1:
NUMERO DE TURNO =
VAR vResource = Table1[RESOURCE]
VAR vStartDate = Table1[START DATE]
VAR vEndDate = Table1[END DATE]
VAR vTeam = Table1[TEAM]
VAR vTable2 =
FILTER (
Table2,
Table2[RESOURCE] = vResource
&& Table2[START DATE] = vStartDate
&& Table2[END DATE] = vEndDate
&& Table2[TEAM] = vTeam
)
VAR vResult =
MAXX ( vTable2, Table2[NUMERO DE TURNO] )
RETURN
vResult
Proud to be a Super User!
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 |
|---|---|
| 50 | |
| 44 | |
| 42 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 69 | |
| 32 | |
| 32 | |
| 32 |