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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Agrupar por rango de fecha inicial, fecha final y asesor (tablas no relacionadas)

Hola comunidad, un placer saludarlos.

 

Me gustaria si me pueden ayudar con lo siguiente:

 

Tengo 2 tablas no relacionadas que detallo a continuación:

 

  • Tabla 1 (CONNID) contiene las llamadas que recibe un asesor con fecha inicial y fecha final, a esta se le asigna un ID único (CONNID)

stewarten_4-1644983327361.png

 

 

  • Tabla 2 (ActivityLog1) muestra las actividades que realizó durante la llamada

 

stewarten_1-1644982938306.png

 

  • Con la formula DAX puedo agrupar las actividades en la franja horaria, llevarle el ID de la llamada y el asesor.

 

IDLLamada =
VAR vLog = MAX(ActivityLog1[Date/Time])
VAR vTable =
FILTER(CONNID, vLog >= CONNID[Fecha Inicial] && vLog <= CONNID[Fecha Final])
VAR vResult = MAXX(vTable, CONNID[CONNID] )
RETURN
vResult
 
AsesorLLamada =
VAR vLog = MAX(ActivityLog1[Date/Time])
VAR vTable =
FILTER(CONNID, vLog >= CONNID[Fecha Inicial] && vLog <= CONNID[Fecha Final])
VAR vResult = MAXX(vTable, CONNID[ASESOR] )
RETURN
vResult
 
stewarten_2-1644983063813.png

 Pero esto me agrupa es todas las actividades dentro de esa franja sin importar el asesor, intente llevando el asesor en una variable y dentro del FILTER con un && agregando la condición pero no lo detecta y saca error. 

 
  • Problema: Requiero que asocie el ID de la llamada a las actividades que pertenecen solo al asesor en esa franja horaria, ya que en ese rango pueden existir varios asesores atendiendo llamada pero con ID diferente.

 

El resultado esperado seria este:

 

stewarten_5-1644983813892.png

 

 

Agradezo de antemano la ayuda que me puedan brindar.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create a new  ID column in Table 2 and then you can join both tables on ID

 


New column in Table 2 =
maxx(filter('Tabla 1' , 'Tabla 1' [Asesor] = 'Tabla 2'[user] && 'Tabla 1' [Date Start] <= 'Tabla 2'[Date] && && 'Tabla 1' [Date end] >= 'Tabla 2'[Date] ), 'Tabla 1' [CONNID])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Create a new  ID column in Table 2 and then you can join both tables on ID

 


New column in Table 2 =
maxx(filter('Tabla 1' , 'Tabla 1' [Asesor] = 'Tabla 2'[user] && 'Tabla 1' [Date Start] <= 'Tabla 2'[Date] && && 'Tabla 1' [Date end] >= 'Tabla 2'[Date] ), 'Tabla 1' [CONNID])

Anonymous
Not applicable

Super!! me funcionó perfectamente, muchas gracias por la ayuda. 😀

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.