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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Varias condiciones

Hola, tengo problemas al crear condicionales, tengo las columnas de Carga (texto), tipo de entrega ( C, A, En blanco), y tengo que desarrollar 4 condicionales,

 

1) Si tiene carga (ya que puede estar en blanco) y tiene tipo de entrega con status En blanco tiene que arrojar que esta ruteado

2) si no tiene carga (en blanco) y tipo de entrega en blanco eso sera igual a "pendiente de ruteo"

3) si tiene carga mas tiene status C es igual a "facturado"

4) si tiene carga y tiene estatus A es igual a "En preparación"

 

como puedo hacer esto? escribiendolo en una medida? 

 

 

De antemano muchas gracias

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Both Power Query and DAX can create a conditional column. 

 

This is an example with Power Query M code. You can add a custom column with below code. 

if [Carga] <> "" and [Delivery type] = "" then "Result A" else if [Carga] = "" and [Delivery type] = "" then "pendiente de ruteo" else if [Carga] <> "" and [Delivery type] = "C" then "facturado" else if [Carga] <> "" and [Delivery type] = "A" then "En preparación" else null

vjingzhang_1-1670293990844.png

 

And this is an example with DAX. 

Result = 
SWITCH(TRUE(),
[Carga]<>"" && [Delivery type]="","Result A",
[Carga]="" && [Delivery type]="","Result B",
[Carga]<>"" && [Delivery type]="C","Result C",
[Carga]<>"" && [Delivery type]="A","Result D",
BLANK()
)

vjingzhang_2-1670294279409.png

 

You can modify above code per your need. I don't understand Spanish well so my examples perhaps don't 100% match your need. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Both Power Query and DAX can create a conditional column. 

 

This is an example with Power Query M code. You can add a custom column with below code. 

if [Carga] <> "" and [Delivery type] = "" then "Result A" else if [Carga] = "" and [Delivery type] = "" then "pendiente de ruteo" else if [Carga] <> "" and [Delivery type] = "C" then "facturado" else if [Carga] <> "" and [Delivery type] = "A" then "En preparación" else null

vjingzhang_1-1670293990844.png

 

And this is an example with DAX. 

Result = 
SWITCH(TRUE(),
[Carga]<>"" && [Delivery type]="","Result A",
[Carga]="" && [Delivery type]="","Result B",
[Carga]<>"" && [Delivery type]="C","Result C",
[Carga]<>"" && [Delivery type]="A","Result D",
BLANK()
)

vjingzhang_2-1670294279409.png

 

You can modify above code per your need. I don't understand Spanish well so my examples perhaps don't 100% match your need. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.