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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
fav_ccc2021
Helper I
Helper I

Busqueda aproximada por condición y rangos con DAX

Hola, por favor su ayuda para realizar la siguiente busqueda de acuerdo un producto, la cantidad ( en un rango ) y el descuento que debe entregarme, lo he intentado pero no logro dar con la formula DAX.

Son tablas : Registros y Productos

 

Registros

fav_ccc2021_0-1611161698147.png

Productos

fav_ccc2021_1-1611161728023.png

 

Debe reflejarse el descuento en la primera tabla , segun la cantidad entre el rango establecido.

Muchas gracias por las respuesta, esto me ha quitado el sueño ya varias noches ....

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@fav_ccc2021 , Create a new column in the table 1

 

maxx(filter(Table2, Table2[Producto] = table1[Producto] && Table2[cantidad Inicial] <= Table[cantidad] && Table2[cantidad final] >= Table1[cantidad]), Table2[descuento])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@fav_ccc2021 , Create a new column in the table 1

 

maxx(filter(Table2, Table2[Producto] = table1[Producto] && Table2[cantidad Inicial] <= Table[cantidad] && Table2[cantidad final] >= Table1[cantidad]), Table2[descuento])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

My friend, you are the BOSS!!! It works perfectly .... Its awesome.,

 

Thanks a lot ...

 

Best regards

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.