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

Next 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

Reply
Syndicate_Admin
Administrator
Administrator

Columna calculada o formula DAX para LOOKUPVALUE

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
RESOURCESTART DATEEND DATETEAMDESCRIPTION OF UNEMPLOYMENTSTART TIMEEND TIMENUMERO DE TURNO
N02DPuen0208/01/202408/01/2024TOMORROWStoppage due to Material Accumulation6:22:297:44:47
N02DPuen0208/01/202408/01/2024LATEStoppage due to Material Accumulation15:00:2316:00:25
N02DPuen0208/01/202409/01/2024NIGHTStoppage due to Material Accumulation23:00:000:32:00
N44PulTB0208/01/202408/01/2024TOMORROWStoppage due to Material Accumulation7:00:257:44:47
N44PulTB0208/01/202408/01/2024LATEStoppage due to Material Accumulation19:00:2121:25:25
N44PulTB0208/01/202409/01/2024NIGHTStoppage due to Material Accumulation23:00:001:25:36
TABLE 2
NUMERO DE TURNORESOURCESTART DATEEND DATESTART TIMEEND TIMETEAM
024-0000001N02DPuen0208/01/202408/01/20246:00:0014:00:00TOMORROW
024-0000025N02DPuen0208/01/202408/01/202414:00:0022:00:00LATE
024-0000032N02DPuen0208/01/202409/01/202422:00:006:00:00NIGHT
024-0000002N44PulTB0208/01/202408/01/20246:00:0014:00:00TOMORROW
024-0000065N44PulTB0208/01/202408/01/202414:00:0022:00:00LATE
024-000098N44PulTB0208/01/202409/01/202422:00:006:00:00NIGHT
1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Leo_Tribaldo,

 

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

 

DataInsights_0-1706289529613.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@Leo_Tribaldo,

 

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

 

DataInsights_0-1706289529613.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you very much @Syndicate_Admin for your help!!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.