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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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])

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])

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

 

Thanks a lot ...

 

Best regards

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors