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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Ramesh-iTalent
Administrator
Administrator

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 Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.