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
Niiru1
Helper V
Helper V

Crear una tabla de combinación para muchos a muchos relaciones DAX SUMMARIZE

Tengo dos tablas:
Tabla de asignaciones

ASSIGNMENT_IDEFFECTIVE_START_DATEEFFECTIVE_END_DATEPERSON_ID
2012712/08/201618/08/201619547
2012722/09/201725/09/201719547
1015304/03/201930/04/201915760

Tabla de empleados:

PERSON_IDDATE_STARTDATE_END
12306/05/201426/06/2014
1954711/03/201916/03/2019
1954712/01/201817/01/2018

Sin embargo, al intentar crear una relación dice:

Esta relación tiene cardinalidad Muchos-Muchos. Esto sólo se utiliza si se espera que ninguna de las columnas (PERSON_ID y PERSON_ID) contenga valores únicos, y que se entienda el comportamiento significativamente diferente de muchas relaciones.

¿Es posible crear una tabla de combinación a partir de una consulta DAX, por ejemplo, resumir tabla?t

Gracias

Consulte el archivo adjunto.

https://www.dropbox.com/s/2rv8is5q63g30td/PERSON_ID%20MANY%20TO%20MANY.pbix?dl=0

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hola @Niiru1 ,

Puede crear una tabla calculada como se indica a continuación:

Table =
VAR assignm_TreatAs =
    TREATAS (
        'Employee Table',
        'Assignment Table'[PERSON_ID],
        'Employee Table'[DATE_START],
        'Employee Table'[DATE_END]
    )
RETURN
    NATURALLEFTOUTERJOIN ( assignm_TreatAs, 'Assignment Table' )

O bien, puede lograrlo mediante Combinar consultas en Power Query.

Cómo cambiar los tipos de unión en Power BI y Power Query

Create join table for many to many relationship DAX SUMMARIZE.JPG

Saludos
Equipo de apoyo comunitario _ Rena Ruan
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más.

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

View solution in original post

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hola @Niiru1 ,

Puede crear una tabla calculada como se indica a continuación:

Table =
VAR assignm_TreatAs =
    TREATAS (
        'Employee Table',
        'Assignment Table'[PERSON_ID],
        'Employee Table'[DATE_START],
        'Employee Table'[DATE_END]
    )
RETURN
    NATURALLEFTOUTERJOIN ( assignm_TreatAs, 'Assignment Table' )

O bien, puede lograrlo mediante Combinar consultas en Power Query.

Cómo cambiar los tipos de unión en Power BI y Power Query

Create join table for many to many relationship DAX SUMMARIZE.JPG

Saludos
Equipo de apoyo comunitario _ Rena Ruan
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más.

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hola

En la tabla Empleado, cree una tabla con solo 1 columna de Person_ID únicas. Esto se puede hacer fácilmente en el Editor de consultas. Ahora vincule cada una de las tablas de datos de origen a esta tabla de ID de empleado única de una sola columna.

Espero que esto ayude.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
NamishB
Post Prodigy
Post Prodigy

Hola @Niiru1

Es posible que necesite una tabla de puentes en el medio al realizar muchas a muchas relaciones en Power BI.

¿Puede echar un vistazo a-

https://radacad.com/many-to-one-or-many-to-many-the-cardinality-of-power-bi-relationship-demystified

Espero que esto ayude

Salud

-Namish B

smpa01
Super User
Super User

@Niiru1 cuál es el resultado final que espera?

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

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.