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

Título dinámico basado en 3 segmentaciones

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.

TheBlacklist_0-1604992713826.png

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"

TheBlacklist_2-1604992817204.png

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!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@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.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@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.

Anonymous
Not applicable

Hola @TheBlacklist puede compartir la muestra de PBIX y el resultado esperado para que pueda ayudar? ¡Gracias!

Anonymous
Not applicable

En sus primeros criterios if, ¿por qué no usar y para comprobar los criterios juntos? ¡Gracias!

Anonymous
Not applicable

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.

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.