Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Ramesh-iTalent
Microsoft Employee
Microsoft Employee

Texto puntuable

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

2 REPLIES 2
harshnathani
Community Champion
Community Champion

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

az38
Community Champion
Community Champion

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
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors