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
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])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

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

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.