Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Tengo una columna de tipos de fruta y quiero añadir una puntuación para cada uno (Manzana 1, Plátano 2, Cereza 3, etc.).
He intentado crear una medida pensando que podría usar una condición IF, pero mi campo de frutas basado en texto no vuelve como una opción.
Mi pensamiento era algo simple como:
If(table[fruit]-"Apple") entonces 1
Else If(table[fruit]-"Banana") y luego 2
Else If(table[fruit]-"Cherry") y luego 3
¿Cómo puedo hacer algo así?
Gracias
Geoff
Hola @geoffgarcia ,
Crear un COlumn calculado
Concept Stage Status =
SWITCH (
TRUE (),
table[fruit] = "Apple", 1,
table[fruit] = "Banana", 2,
table[fruit] = "Cherry", 3,
BLANK ()
)
saludos
Harsh Nathani
Hola @geoffgarcia
es mejor crear una columna con SWITCH() como
Column =
SWITCH(table[fruit],
"Apple", 1,
"Banana", 2,
"Cherry", 3,
0
)
pero si todavía necesita una medida tratar
Column =
var _fruit = MAX(table[fruit])
RETURN
SWITCH(_fruit,
"Apple", 1,
"Banana", 2,
"Cherry", 3,
0
)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.