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
lbianqui
New Member

Doble condición SQL

Hola, me podrán orientar con una sentencia SQL.

1. Necesito recuperar de una DB todos los registros que tienen un valor determinado

2. De esos registros recuperados, si uno de los campos tienen más de un registro con el mismo valor haga una cuenta mediante una regla de tres.

 

Por ejemplo: tengo n cantidad de registros, de todos esos tengo que identificar los que corresponden a la lista de precios X y de estos si el número de pedido se repite más de una vez, aplicar una cuenta (regla de tres) y pegar el resultado en un nuevo campo. 

Es decir, tengo que ver todos los registros de la lista X, pero si tiene más de un registro nro de pedido que haga el cálculo, sino que quede en blanco / null.

 

Espero me haya podido explicar. Gracias

2 REPLIES 2
Anonymous
Not applicable

Hi @lbianqui ,

 

Could you please confirm if you still need help with your issue? We'd be happy to assist!

Based on your description, I think you asked a question that might not be directly related to Power Query.

Do you want to merge two tables in Power Query for comparison and then turn the same cell into one cell?

Maybe you could follow the reference:

Merge queries overview - Power Query | Microsoft Learn

How to combine rows in Power Query (exceloffthegrid.com)

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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 Solution Authors