cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aamnb7
Frequent Visitor

Columna calculada power query con 3 condiciones

Estimados,

como deberia ser la sintaxis para crear una columna en power query (no dax) que cumpla 3 condiciones?

probé con && pero solo funciona en Dax, necesito que cumpla 3 condiciones....

de antemano gracias!!!!!

 

por ej

 

Table.AddColumn(#"Columnas con nombre cambiado2", "Dist_Adm", each if [code] = "SER" AND [mes2]=01 AND [año2]=2022 then 0.22047244 else null)

1 ACCEPTED SOLUTION
TheoC
Super User
Super User

Hi @aamnb7

 

You can create a Custom Column (go to the ribbon and click on Add Column) that uses the following:

 

Puede crear una columna personalizada (vaya a la cinta y haga clic en Agregar columna) que use lo siguiente:

 

if [code] = "SER" and [month2] = 1 then 0.22047244 else null

TheoC_1-1652412823459.png

 

However, you need to be sure that your [month2] column is 123 (Number) like I have in my screenshot.  Otherwise, instead of using the number 1, you need to add quotes to "01" like below:

 

Sin embargo, debe asegurarse de que su columna [month2] sea 123 (Número) como tengo en mi captura de pantalla. De lo contrario, en lugar de usar el número 1, debe agregar comillas a "01" como se muestra a continuación:

 

if [code] = "SER" and [month2] = "01" then 0.22047244 else null

 

TheoC_2-1652412905225.png

I hope this helps and all the best!

Espero que esto ayude y todo lo mejor!

Theo

 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

2 REPLIES 2
aamnb7
Frequent Visitor

Gracias !! tenía las columnas en formato texto, no me había dado cuenta, ahora me resultó, muchas gracias, saludos !! 

TheoC
Super User
Super User

Hi @aamnb7

 

You can create a Custom Column (go to the ribbon and click on Add Column) that uses the following:

 

Puede crear una columna personalizada (vaya a la cinta y haga clic en Agregar columna) que use lo siguiente:

 

if [code] = "SER" and [month2] = 1 then 0.22047244 else null

TheoC_1-1652412823459.png

 

However, you need to be sure that your [month2] column is 123 (Number) like I have in my screenshot.  Otherwise, instead of using the number 1, you need to add quotes to "01" like below:

 

Sin embargo, debe asegurarse de que su columna [month2] sea 123 (Número) como tengo en mi captura de pantalla. De lo contrario, en lugar de usar el número 1, debe agregar comillas a "01" como se muestra a continuación:

 

if [code] = "SER" and [month2] = "01" then 0.22047244 else null

 

TheoC_2-1652412905225.png

I hope this helps and all the best!

Espero que esto ayude y todo lo mejor!

Theo

 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
Power BI Show Episode 10 Recap

The Power BI Community Show

Watch the playback when Amit Chandak, a Power BI Super User, demos how to use Field Parameters to make reports more dynamic.

Power BI Dev Camp Session 26

Ted's Dev Camp - October 6, 2022

Watch the playback of Session 26 with Ted Pattison!

Health and Life Sciences Power BI User Group

Health and Life Sciences Power BI User Group

Power BI specialists at Microsoft have created a community user group where customers in the provider, payor, pharma, health solutions, and life science industries can collaborate.

Ignite 2022

What's Next at Microsoft Ignite 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Top Solution Authors