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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Declaración IF

Hola a todos

Tengo una declaración IF que funciona bien. Véase más abajo

GoldenBatch =
SI (
[thaw_onTime] = "Y"
&& [proA_onTime] = "Y"
&& [BDS_onTime] = "Y"
&& [harvest_onTime] = "Y"
&& [%RFT_RFT] = "Y"
&& [titer_inFull] = "Y"
&& [yield_inFull] = "Y"
&& [deviation_RFT] = "Y",
"Lote de oro",
"Señorita"
)

I want to modify condition in order to have three outputs all under one column i.e
"Lote de oro", "Miss", "In Progress".
Esto es lo que quiero hacer
GoldenBatch =
SI (
[thaw_onTime] = "Y"
&& [proA_onTime] = "Y"
&& [BDS_onTime] = "Y"
&& [harvest_onTime] = "Y"
&& [%RFT_RFT] = "Y"
&& [titer_inFull] = "Y"
&& [yield_inFull] = "Y"
&& [deviation_RFT] = "Y",
"Lote de oro"
)
||
GoldenBatch =
SI (
[thaw_onTime] = "N"
&& [proA_onTime] = "N"
&& [BDS_onTime] = "N"
&& [harvest_onTime] = "N"
&& [%RFT_RFT] = "N"
&& [titer_inFull] = "N"
&& [yield_inFull] = "N"
&& [deviation_RFT] = "N",
"Señorita",
||


SI(
[thaw_onTime] = EN BLANCO()
|| [proA_onTime] = EN BLANCO()
|| [BDS_onTime] = EN BLANCO()
|| [harvest_onTime] = EN BLANCO()
|| [%RFT_RFT] = EN BLANCO()
|| [titer_inFull] = EN BLANCO()
|| [yield_inFull] = EN BLANCO()
|| [deviation_RFT] = EN BLANCO(),
"En progreso"
)

¿Cuál es la mejor manera de escribir el DAX para que la instrucción if tenga más de 3 variables de salida?
1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

De hecho, encontré una solución a esto.
1. O bien utilizar sentencias IF anidadas

2. Utilice la función de interruptor

La instrucción IF anidada dificultará su lectura, por lo que la función SWITCH funciona. Vea la solución a continuación

GoldenBatch =
INTERRUPTOR (
VERDADERO (),
[thaw_onTime] = "Y"
&& [proA_onTime] = "Y"
&& [BDS_onTime] = "Y"
&& [harvest_onTime] = "Y"
&& [%RFT_RFT] = "Y"
&& [titer_inFull] = "Y"
&& [yield_inFull] = "Y"
&& [deviation_RFT] = "Y", "Lote de oro",
[thaw_onTime] = "N"
|| [proA_onTime] = "N"
|| [BDS_onTime] = "N"
|| [harvest_onTime] = "N"
|| [%RFT_RFT] = "N"
|| [titer_inFull] = "N"
|| [yield_inFull] = "N"
|| [deviation_RFT] = "N", "Señorita",
[thaw_onTime] = ESPACIO EN BLANCO ()
|| [proA_onTime] = ESPACIO EN BLANCO ()
|| [BDS_onTime] = ESPACIO EN BLANCO ()
|| [harvest_onTime] = ESPACIO EN BLANCO ()
|| [%RFT_RFT] = ESPACIO EN BLANCO ()
|| [titer_inFull] = ESPACIO EN BLANCO ()
|| [yield_inFull] = ESPACIO EN BLANCO ()
|| [deviation_RFT] = ESPACIO EN BLANCO (), "En progreso"
)

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

De hecho, encontré una solución a esto.
1. O bien utilizar sentencias IF anidadas

2. Utilice la función de interruptor

La instrucción IF anidada dificultará su lectura, por lo que la función SWITCH funciona. Vea la solución a continuación

GoldenBatch =
INTERRUPTOR (
VERDADERO (),
[thaw_onTime] = "Y"
&& [proA_onTime] = "Y"
&& [BDS_onTime] = "Y"
&& [harvest_onTime] = "Y"
&& [%RFT_RFT] = "Y"
&& [titer_inFull] = "Y"
&& [yield_inFull] = "Y"
&& [deviation_RFT] = "Y", "Lote de oro",
[thaw_onTime] = "N"
|| [proA_onTime] = "N"
|| [BDS_onTime] = "N"
|| [harvest_onTime] = "N"
|| [%RFT_RFT] = "N"
|| [titer_inFull] = "N"
|| [yield_inFull] = "N"
|| [deviation_RFT] = "N", "Señorita",
[thaw_onTime] = ESPACIO EN BLANCO ()
|| [proA_onTime] = ESPACIO EN BLANCO ()
|| [BDS_onTime] = ESPACIO EN BLANCO ()
|| [harvest_onTime] = ESPACIO EN BLANCO ()
|| [%RFT_RFT] = ESPACIO EN BLANCO ()
|| [titer_inFull] = ESPACIO EN BLANCO ()
|| [yield_inFull] = ESPACIO EN BLANCO ()
|| [deviation_RFT] = ESPACIO EN BLANCO (), "En progreso"
)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Kudoed Authors