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.
Hola a todos
Estoy tratando de crear un título basado en lo que se selecciona en 3 segmentaciones de datos. Estas 3 segmentaciones son jerarquías.
Quiero un título que muestre qué centro de beneficio está seleccionado en la segmentación. Si se selecciona el nivel 3 del centro de beneficio, se mostrará "Categorías de productos de Nueva Zelanda" en el informe.
Si se selecciona el nivel 4, el título mostrará "Cultivos cubiertos" en lugar de lo que se selecciona en el nivel 3. Como se indica a continuación:
Luego, cuando se selecciona el nivel 5, se mostraría "Capsicums"
Aquí está el DAX que he intentado hasta ahora, pero no funciona:
Measure Title =
IF (
HASONEFILTER ( 'Profit Center'[Profit Center Level 3 Text] ),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 3 Text] ),
IF (
AND (
HASONEVALUE ( 'Profit Center'[Profit Center Level 3 Text] ),
HASONEVALUE ( 'Profit Center'[Profit Center Level 4 Text] )
),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 4 Text] ),
IF (
(
HASONEVALUE ( 'Profit Center'[Profit Center Level 3 Text] )
&& HASONEVALUE ( 'Profit Center'[Profit Center Level 4 Text] )
&& HASONEVALUE ( 'Profit Center'[Profit Center Level 5 Text] )
),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 5 Text] )
)
)
)
Gracias en avanzado!
Solved! Go to Solution.
@alex00321 logré averiguarlo. terminó cambiando el orden de la declaración IF y funcionó!
IF (
HASONEVALUE ( 'Profit Center'[Profit Center Level 3 Text] )
&& HASONEVALUE ( 'Profit Center'[Profit Center Level 4 Text] )
&& HASONEVALUE ( 'Profit Center'[Profit Center Level 5 Text] ),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 5 Text] ),
IF (
AND (
HASONEVALUE ( 'Profit Center'[Profit Center Level 3 Text] ),
HASONEVALUE ( 'Profit Center'[Profit Center Level 4 Text] )
),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 4 Text] ),
IF (
HASONEFILTER ( 'Profit Center'[Profit Center Level 3 Text] ),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 3 Text] ),
"TG Fresh"
)
)
)
Gracias por tu ayuda.
@alex00321 logré averiguarlo. terminó cambiando el orden de la declaración IF y funcionó!
IF (
HASONEVALUE ( 'Profit Center'[Profit Center Level 3 Text] )
&& HASONEVALUE ( 'Profit Center'[Profit Center Level 4 Text] )
&& HASONEVALUE ( 'Profit Center'[Profit Center Level 5 Text] ),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 5 Text] ),
IF (
AND (
HASONEVALUE ( 'Profit Center'[Profit Center Level 3 Text] ),
HASONEVALUE ( 'Profit Center'[Profit Center Level 4 Text] )
),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 4 Text] ),
IF (
HASONEFILTER ( 'Profit Center'[Profit Center Level 3 Text] ),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 3 Text] ),
"TG Fresh"
)
)
)
Gracias por tu ayuda.
Hola @TheBlacklist puede compartir la muestra de PBIX y el resultado esperado para que pueda ayudar? ¡Gracias!
En sus primeros criterios if, ¿por qué no usar y para comprobar los criterios juntos? ¡Gracias!
Hola @alex00321 gracias por la respuesta! ¿Puede proporcionar un ejemplo utilizando la función AND por favor? No creo que funcione como el primer criterio que sólo quiero mostrar el valor de "texto de nivel 3 del centro de beneficios" cuando esta es la única segmentación seleccionada.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |