Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join 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
)
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.