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
em12963
Helper I
Helper I

Cree una nueva columna que haga referencia a tres tablas unidas

Hola, tengo tres tablas que tienen una relación de filtro cruzado de muchos a uno con la tabla Main y las dos tablas secundarias respectivamente.

Tabla principal:

Clave

Estudiante

Pasar

1

A

1

2

B

0

Tabla secundaria 1:

Clave

School_Decile

1

1

2

2

3

3

Tabla secundaria 2:

Clave

School_Decile

1

2

2

4

3

2

Me gustaría crear una nueva columna dentro de la tabla principal que hace referencia a la columna Pass (de la tabla Main) y a New School Decile de la tabla Secundaria 1 y la tabla secundaria 2 respectivamente.

Mi salida deseada es tener la nueva columna en la tabla principal:

Clave

Estudiante

Pasar

Nueva columna

1

A

1

Se trasladó a la disminución del decil

2

B

0

Fallado

Nueva columna ?

IF (Main[Pass]-0, "Failed",

IF (Tabla secundaria 1 [School_Decile] > Tabla secundaria 2[School_Decile], "Moved to higher decile",

IF (Tabla secundaria 1 [School_Decile] < Tabla secundaria 2 [School_Decile], "Moved to lower decile",

IF (Tabla secundaria 1 [School_Decile] - Tabla secundaria 2 [School_Decile], "Moved to same decile",

"IFERROR"))))

¿Cómo creo el DAX en una nueva columna dentro de la tabla Main que hace referencia a las tres tablas?

Cualquier entrada sería muy apreciada, muchas gracias de antemano!

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@em12963 agregar la siguiente expresión para la nueva columna en la tabla principal

New column =
SWITCH (TRUE(),
Main[Pass]=0, "Failed",
RELATED('Secondary table 1'[School_Decile]) > RELATED('Secondary table 2'[School_Decile]), "Moved to higher decile",
RELATED('Secondary table 1'[School_Decile]) < RELATED('Secondary table 2'[School_Decile]), "Moved to lower decile",
RELATED('Secondary table 1'[School_Decile])= RELATED('Secondary table 2'[School_Decile]), "Moved to same decile", “IFERROR”,
"Unknown" --catch all
)

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionados con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

1 REPLY 1
parry2k
Super User
Super User

@em12963 agregar la siguiente expresión para la nueva columna en la tabla principal

New column =
SWITCH (TRUE(),
Main[Pass]=0, "Failed",
RELATED('Secondary table 1'[School_Decile]) > RELATED('Secondary table 2'[School_Decile]), "Moved to higher decile",
RELATED('Secondary table 1'[School_Decile]) < RELATED('Secondary table 2'[School_Decile]), "Moved to lower decile",
RELATED('Secondary table 1'[School_Decile])= RELATED('Secondary table 2'[School_Decile]), "Moved to same decile", “IFERROR”,
"Unknown" --catch all
)

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionados con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.