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
Anonymous
Not applicable

Uso de la relación inactiva para rellenar huecos en los datos

Hola a todos,

Estoy tratando de usar una relación inactiva para llenar vacíos en mis datos. Tengo una tabla de hechos y una tabla de dimensiones. Hay dos relaciones, 1 activa y 1 inactiva, que se muestra a continuación:

chasedalton_1-1608224810385.png

En mi tabla de datos (Datos), hay 2 columnas: Contrato y Colectivo de contratos. Mi tabla Dimension (Encabezado de contrato) se une al contrato , por lo que puedo extraer la información de cliente y proveedor asociada con el contrato. Los datos combinados se parecen a la tabla izquierda de abajo (tabla derecha es mi tabla de dimensiones):

chasedalton_4-1608224989522.png

Tenga en cuenta cómo en la fila inferior, el número de contrato y el colectivo de contrato no coinciden. Lo que quiero hacer es que cuando el Contrato y el Colectivo de Contratos no coincidan y se devuelva un valor null para el proveedor, quiero usar la relación inactiva (que se basa en el Colectivo de Contratos) para devolver el proveedor para el Colectivo de Contratos (que sería el Club de Samm en este caso). ¿Alguien puede ayudar con esto?

11 REPLIES 11
parry2k
Super User
Super User

@chasedalton bien escuchar, recomendaría pegar la solución para que otros puedan obtener ayuda de it.s



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.

parry2k
Super User
Super User

@chasedalton compartir con una unidad drive/google



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.

Anonymous
Not applicable

Todo está bien, ¡encontré una solución!

parry2k
Super User
Super User

@chasedalton agregar una nueva columna como esta como ejemplo para un proveedor.

En mi ejemplo, el Cliente representa la tabla Encabezado de contrato y la Tabla representa la tabla de datos.

Vendor 1 = 
VAR __vendor = RELATED ( Customer[Vendor] )
VAR __vendorIfBlank = 
IF ( COALESCE( __vendor, "" ) = "", 
    MAXX ( 
        Customer, 
        CALCULATE ( 
            MAX ( Customer[Vendor] ), 
            USERELATIONSHIP ( Customer[Column1], 'Table'[Col2]  ) 
        ) 
    ),
    __vendor 
)
RETURN __vendorIfBlank 

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



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.

Anonymous
Not applicable

Lo intenté, y no pude usar COALESCE, así que acabo de usar ISBLANK en su lugar. Esto es lo que pasó cuando lo probé: image.png

Anonymous
Not applicable

Cambié mis títulos de tabla de datos para que coincidan con su uso de ellos

No @chasedalton,

Para su escenario, creo que puede causar el problema de referencia de "dependencia circular" debido al conflicto de asignación de dos relaciones (activadas y desactivadas).

En mi opinión, me gustaría sugerirle que utilice todas las funciones para ignorar el filtro y aplicar manualmente el filtro a sus expresiones, puede evitar el problema de "dependencia circular".

Gestión de "todas" funciones en DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT
saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

¿cómo?

No @chasedalton,

¿Puede compartir un archivo pbix con algunos datos ficticios con una estructura de datos similar a la estructura de tabla sin procesar? Debería ayudarnos a aclarar su escenario y probar la fórmula de codificación.

Cómo obtener respuestas a su pregunta rápidamente

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

¿Cómo agredo un archivo? Tengo un pbix, pero no veo una opción para compartirlo?

HAY @chasedalton,

Puede cargar su archivo en onedrive para la empresa y compartir el enlace aquí.

Aviso: no adjunte sensitive en el archivo de ejemplo.

saludos

Xiaoxin Sheng

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.