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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Como buscar un valor en otra tabla con condiciones

Hola! Me podrian ayudar con una formula dax:
Tengo 2 tablas:

tabla 1

suazoyanina1_1-1641993435465.png

tabla 2
suazoyanina1_0-1641993413560.png

Necesito traer de la segunda tabla el valor ID_Operador, si las filas coinciden en fecha, equipo y la hora está entre el rango; es decir:
SI Tabla 1 (Fecha) = Tabla 2 (fecha) , tabla 1 (equipo) = tabla 2 (equipo) y  tabla 1 (hora) >= tabla 2 (inicio) && tabla 1 (hora) <= tabla 2 (fin)

Resultado = ID_Operador.

espero puedan ayudarme!
gracias.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , New column in table 1

 

maxx(filter(Tabla2 , 'SI Tabla 1' [Fecha] = Tabla2 [fecha] && 'tabla 1'[equipo] = tabla2[equipo] &&  'tabla 1'[hora] >= tabla2 [inicio] && 'tabla 1'[hora] <= tabla2[fin]) ,tabla2[ID_Operador])

 

 

Correct table name and column name as per need

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , New column in table 1

 

maxx(filter(Tabla2 , 'SI Tabla 1' [Fecha] = Tabla2 [fecha] && 'tabla 1'[equipo] = tabla2[equipo] &&  'tabla 1'[hora] >= tabla2 [inicio] && 'tabla 1'[hora] <= tabla2[fin]) ,tabla2[ID_Operador])

 

 

Correct table name and column name as per need

Anonymous
Not applicable

Yo tengo un problema similar, tengo dos tablas y necesito que me regrese en la Tabla 1 la Materia y el Nivel de la tabla 2, tomando en cuenta el Bloque, la Fecha y la Hora superior más próxima. Ejemplo:

 

Tabla 1

 

BLOQUEFECHAID_PHORA_TRANSMATERIANIVEL
101/11/2022818777606:50:51BIOLOGIABIOLOGIA CELULAR
201/11/2022816677802:04:49CONTABILIDADCONTABILIDAD IV

 

sicruzp_0-1675816159863.png

 

Tabla 2

BLOQUEFECHAHORA_INICIOMATERIANIVEL
101/11/202212:06:24 a. m.CIENCIASCIENCIAS AVANZADAS II
101/11/202212:36:24 a. m.MATEMATICASECUACIONES DIFERENCIALES
101/11/202201:10:02 a. m.LITERATURALITERATURA CLASICA
101/11/202206:52:08 a. m.BIOLOGIABIOLOGIA CELULAR
101/11/202207:31:15 a. m.QUIMICAQUIMICA DE LOS ELEMENTOS
101/11/202209:00:12 a. m.ESPAÑOLCOMPENDIO GRAMATICAL
101/11/202210:00:18 a. m.ANATOMIAANATOMIA HUMANA
201/11/202212:00:10 a. m.ECONOMIAMACROECONOMIA GLOBAL
201/11/202207:00:00 a. m.CONTABILIDADCONTABILIDAD IV
201/11/202207:29:57 a. m.FINANZASINTERES FIJO VS INTERES VARIABLE
201/11/202207:59:52 a. m.ADMINISTRACIÓNTIEMPOS Y ESFUERZOS
201/11/202208:29:58 a. m.MATEMATICAS AVANZADASINTEGRALES

sicruzp_1-1675816202154.png

 

Ojala que me puedan ayudar 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors