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
thatjoey20
Helper I
Helper I

Insertar diferentes valores en una columna en función de diferentes condiciones

Hola chicos,


Estoy luchando por definir esta declaración DAX,

básicamente tengo una tabla donde hay ID_SELLER, VENDEDOR DE NOMBRE, NUM MES y quiero insertar GOAL VALUE de manera diferente a través de los meses para cada vendedor

Por ejemplo, si ID_SELLER 300 && MES NUM - 1, VALOR DE OBJETIVO - 120000
'' NUM DE MES 2, VALOR DE LA META A 130000
más adelante
301 MES NUMERO 1.... VALOR 50000
2

Intenté usar SWITCH(IF(ID_SELLER á 300 && MONTH NUM á 1, TRUE()), TRUE(), 120000)


pero no sabía cómo seguir insertando otros meses ya que DAX no me permite establecer valores en condiciones variables. Creo que esto resultaría en una declaración de muchas líneas, ¿alguien tiene una solución simillar o puede ayudar con algo?

Muchas gracias

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@thatjoey20 , Crear una nueva columna como

VALOR DE OBJETIVO - Interruptor( True(),
[ID_SELLER] a 300 && [MES NUM] a 1, 120000,
[ID_SELLER] a 300 && [MES NUM] a 2,130000
añadir otros
)

View solution in original post

3 REPLIES 3
Nathaniel_C
Super User
Super User

Hola @thatjoey20 ,
Prueba esta medida

GOAL TO REACH =
IF (
    Goals[Seller ID] = 300
        && Goals[Month #] = 1,
    12000,
    IF (
        Goals[Seller ID] = 300
            && Goals[Month #] = 2,
        13000,
        IF ( Goals[Seller ID] = 301 && Goals[Month #] = 1, 50000 )
    )
)

seller.PNG


Avísame si tienes alguna pregunta.

Si esto resuelve sus problemas, márquelo como la solución, para que otros puedan encontrarlo fácilmente. Kudos 👍son agradables también.
Nathaniel





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

Proud to be a Super User!




amitchandak
Super User
Super User

@thatjoey20 , Crear una nueva columna como

VALOR DE OBJETIVO - Interruptor( True(),
[ID_SELLER] a 300 && [MES NUM] a 1, 120000,
[ID_SELLER] a 300 && [MES NUM] a 2,130000
añadir otros
)

¡¡Funcionó!! ¡Muchas gracias! Sólo necesitaba poner true como una condición de expresió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.