Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hola
Tengo 2 columnas que provienen del cliente, por ejemplo, ID1 e ID2 (tabla de hechos)
Establezco relación con dim_emp entre (Dim_ID1) y (Fact_ID1 )
La relación funciona bien para la mayoría de los agentes
pero tengo un problema que algunos agentes que provienen del cliente no tienen ID1 pero tienen ID2
así que quiero decirle a Power BI si no encontró ID1, así que haga la relación con ID2
¿Cómo puedo hacer eso?
Hola @ahmedshalabyy12,
Espero que hayan tenido la oportunidad de revisar la solución compartida por @Shivu-2000 . Si abordó su pregunta, considere aceptarlo como la solución: ayuda a otros a encontrar respuestas más rápidamente.
Si sigues teniendo el problema, no dudes en responder y estaremos encantados de ayudarte.
Gracias.
Hola @ahmedshalabyy12
Según tengo entendido, sus datos son los siguientes:
Tiene una tabla Fact que contiene dos columnas de ID del cliente:
ID1
ID2
You also have a Dimension table (Dim_Emp) with the column:
Dim_ID1
Actualmente, ha creado una relación entre:
Fact[ID1] →
Dim_Emp[Dim_ID1]
This works fine for most agents.
However, for some records, ID1 is blank or missing, but
ID2 has a valid value.
You want Power BI to fall back to use ID2 when
ID1 is not available for establishing the relationship.
My solution to this will be create a new
Calculated column the Fact table that acts as a fallback ID by checking
ID1 first, and using
ID2 if
ID1 is blank.
En Power BI, vaya a la tabla de hechos y cree una nueva columna con el siguiente DAX:
Effective_ID = IF ( NOT ISBLANK(Fact[ID1]), Fact[ID1], Fact[ID2] )
En la vista de modelo:
Delete the existing relationship between Fact[ID1] and
Dim_Emp[Dim_ID1]
Cree una nueva relación entre:
Fact[Effective_ID] →
Dim_Emp[Dim_ID1]
This ensures Power BI uses ID1 when it’s present, and falls back to
ID2 otherwise.
Si esta publicación ayuda, considere Acéptalo como la solución para ayudar a los demás miembros a encontrarlo más rápidamente.
¡Feliz de ayudar!
Gracias que funcionó aperci su esfuerzo