Forum Discussion

MariaCL's avatar
MariaCL
Regular Visitor
2 years ago
Solved

Filtros entre tablas

Hola! Necesito ayuda para saber si es posible hacer lo siguiente con alguna medida DAX. Tengo una tabla de datos con ID de posiciones y datos sobre esas posicione por ejemplo su Job Profile. Por otro lado, tengo una tabla de dotación con información sobre colaboradores que contiene el ID de posición y algunos datos sobre la posición. Lo que necesito es que al filtrar por un código de posición, en un gráfico ver todas las personas que tengan una posición que tenga el mismo job profile que la posición filtrada. Cabe aclarar que los IDs de posición son todos distintos, es decir, no puede haber muchas personas con un solo ID de posición. Paso el ejemplo ficticio de las columnas y el resultado esperado:

 

  • Archivo Posiciones:
Position IDJob Profile
POS0000825Country Marketer
POS0002438Country Marketer
POS0004010Quality Manager
POS0004019Researcher
POS0004021Tax Manager
POS0004024Quality Specialist

 

  • Archivo Dotación:
Employee IDNamePosition IDJob Profile

1

MaríaPOS0000825Country Marketer

2

JuanaPOS0004010Quality Manager

3

PedroPOS0004867Country Marketer

4

GustavoPOS0004868Country Marketer

5

JuanPOS0004872Country Marketer

 

Resultado Esperado:

Que la filtrar con un segmentador de datos el Position ID POS0000825, el gráfico me muestre los que comparten el mismo Job Profile, es decir, todos menos un caso.

 

1

MaríaPOS0000825Country Marketer

3

PedroPOS0004867Country Marketer

4

GustavoPOS0004868Country Marketer

5

JuanPOS0004872Country Marketer

 

Muchas gracias!

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi MariaCL 

     

    Depending on your problem, here are the solutions we offer you

     

    Here are the data for two tables

     

    Archivo Posiciones

     

    Archivo Dotación

     

    First, establish a relationship between the two tables based on 'Job Profile'. Go to “Model view”, and then drag the “Job Profile” column of one table to the “Job Profile” column of another table.

     

    Create a measure that filters based on the Job Profile of the selected employee ID.

     

    select_JobProfile = 
         CALCULATE (
             COUNTROWS('Archivo Dotación'),
             FILTER (
                 ALL('Archivo Posiciones'),
                 'Archivo Posiciones'[Job Profile] = SELECTEDVALUE('Archivo Dotación'[Job Profile])
             )
         )
    

     

     

    Add a table and a slicer visual

    Here is the result

    Best Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi MariaCL 

     

    Depending on your problem, here are the solutions we offer you

     

    Here are the data for two tables

     

    Archivo Posiciones

     

    Archivo Dotación

     

    First, establish a relationship between the two tables based on 'Job Profile'. Go to “Model view”, and then drag the “Job Profile” column of one table to the “Job Profile” column of another table.

     

    Create a measure that filters based on the Job Profile of the selected employee ID.

     

    select_JobProfile = 
         CALCULATE (
             COUNTROWS('Archivo Dotación'),
             FILTER (
                 ALL('Archivo Posiciones'),
                 'Archivo Posiciones'[Job Profile] = SELECTEDVALUE('Archivo Dotación'[Job Profile])
             )
         )
    

     

     

    Add a table and a slicer visual

    Here is the result

    Best Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.