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
elflakoconk
Helper II
Helper II

Error utilizando RELATED

Hola a todos, he buscado por todo el foro y no he dado con una respuesta que me resuelva.

 

Estoy trabajando con Direct Query, tengo 2 tablas:

 

imagn.png

 

El campo de vínculo es Telefono y como pueden ver es de muchos a uno. Quiero insertar en A una columna que indique cuando se tiene el mismo valor en B.

 

objetivo.jpg

 

 

He intentado con RELATED y el resutlado es este mensaje: "The column 'B[Telefono]' either doesn't exist or doesn't have a relationship to any table available in the current context.

Incluso (me permite) cambiando la relación uno a uno, aparece el mismo error.

He intentado con otras formulas que he encontrado en internet sin resolver esto.
Gracias.

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

Hola @elflakoconk ,

Puede crear una medida como se indica a continuación:

Measure = 
VAR _btelefono =
    CALCULATE (
        MAX ( 'B'[Telefono] ),
        FILTER ( 'B', 'B'[Telefono] = MAX ( 'A'[Telefono] ) )
    )
RETURN
    IF ( NOT ( ISBLANK ( _btelefono ) ), "Si", "No" )

error using related.JPG

Saludos

Rena

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

6 REPLIES 6
v-yiruan-msft
Community Support
Community Support

Hola @elflakoconk ,

Puede crear una medida como se indica a continuación:

Measure = 
VAR _btelefono =
    CALCULATE (
        MAX ( 'B'[Telefono] ),
        FILTER ( 'B', 'B'[Telefono] = MAX ( 'A'[Telefono] ) )
    )
RETURN
    IF ( NOT ( ISBLANK ( _btelefono ) ), "Si", "No" )

error using related.JPG

Saludos

Rena

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.

Muchas gracias, esto funcionó!!! el equipo de Microsoft me comento que las interacciones con DirectQuery pueden presentar algunas fallas con SQL Server, en mi caso sucedió, pero con esto se soluciona.

Muchas gracias.

Hola @elflakoconk ,

Si el problema se ha resuelto, ¿podría marcar el mensaje útil como Respondido? Ayudará a otros en la comunidad a encontrar la solución rápidamente cuando se enfrentan al mismo problema con usted. Gracias.

Saludos

Rena

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.
ryan_mayu
Super User
Super User

@elflakoconk

Si desea utilizar relacionados, pruebe este

Column = 
VAR _value=MAXX(FILTER(B,RELATED(B[telefono])),B[value])
return if (ISBLANK(_value),"No",_value)

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@elflakoconk , Relacionado se puede utilizar en relación 1- M en el lado M.

también puede mover datos como este de la mesa a otro

Nombre de la ciudad: maxx(FILTER(geography,geography[City Id]-Sales[City Id]),geography[City]) // New column in sales table in my case

Minx/maxx/sumx dependen de la necesidad

Muchas gracias, ¡probaré esto! y dará mi opinión

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.