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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DagosKev
New Member

Power Query - Traer valor de otra tabla bajo dos condiciones

Tengo dos tablas en Power Query:

Sales_table > ventas realizadas

Cost_Table > Costos del producto por fecha

 

No encuentro la manera de traer el costo del producto (Cost_Table) a mi tabla de ventas (Sales_Table).

Las condiciones deberían ser:

Sales_Table.ITEM = Cost_Table.ITEM

Sales_Table.DATE >= Cost_Table.DATE

 

El resultado debería ser el siguiente:

result.PNG

 

Lo he intentado con table,selectrow y joins... pero no termino de lograr la solución.

 

Agradezco cualquier ayuda.

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@Syndicate_Admin , Pruebe una nueva columna como

nueva columna =
var _max = maxx( filter(Sales_Table, Sales_Table[ITEM] = Cost_Table[ITEM] && Cost_Table[DATE] <= Sales_Table[DATE] ),Cost_Table[DATE] )
devolución
maxx( filter(Sales_Table, Sales_Table[ITEM] = Cost_Table[ITEM] && Cost_Table[DATE]= _max,Cost_Table[Cost] )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Kudoed Authors