Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Buenas tardes, de antemano agradecerlos por la ayuda, tengo una tabla de (precios de producto) que va cambiando constantemente, lo que necesito es traer los precios actualizados a la tabla de ventas para poder sumar y obtener el total, o hay otra forma mas sencilla de poder obtener el total de ventas?
Solved! Go to Solution.
Hi @Manuu_108 ,
Here are the steps you can follow:
1. In Power query. Add Column – Index Column – From 1 (Add for Ventas table)
2. Create measure.
measure_Precio Unitario =
var _max=CALCULATE(MAX('Table de Precio'[FechaPrecio]),FILTER(ALL('Table de Precio'),'Table de Precio'[SKU]=MAX('Ventas'[SKU])&&'Table de Precio'[FechaPrecio]<=MAX('Ventas'[Fecha Venta])))
return
CALCULATE(SUM('Table de Precio'[Precio Unitario]),FILTER(ALL('Table de Precio'),'Table de Precio'[SKU]=MAX('Ventas'[SKU])&&'Table de Precio'[FechaPrecio]=_max))
Flag =
[measure_Precio Unitario] * MAX('Ventas'[Pedido])
Total Ventas =
var _table=SUMMARIZE('Ventas','Ventas'[Index],"_value",[Flag])
return
IF(HASONEVALUE('Ventas'[Index]),[Flag],SUMX(_table,[_value]))
3. Result:
If you need pbix, please click here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Manuu_108 ,
Here are the steps you can follow:
1. In Power query. Add Column – Index Column – From 1 (Add for Ventas table)
2. Create measure.
measure_Precio Unitario =
var _max=CALCULATE(MAX('Table de Precio'[FechaPrecio]),FILTER(ALL('Table de Precio'),'Table de Precio'[SKU]=MAX('Ventas'[SKU])&&'Table de Precio'[FechaPrecio]<=MAX('Ventas'[Fecha Venta])))
return
CALCULATE(SUM('Table de Precio'[Precio Unitario]),FILTER(ALL('Table de Precio'),'Table de Precio'[SKU]=MAX('Ventas'[SKU])&&'Table de Precio'[FechaPrecio]=_max))
Flag =
[measure_Precio Unitario] * MAX('Ventas'[Pedido])
Total Ventas =
var _table=SUMMARIZE('Ventas','Ventas'[Index],"_value",[Flag])
return
IF(HASONEVALUE('Ventas'[Index]),[Flag],SUMX(_table,[_value]))
3. Result:
If you need pbix, please click here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Puedes por favor publicar la información en formato datos en lugar de imágenes?
Proud to be a Super User!
Paul on Linkedin.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
87 | |
87 | |
68 | |
66 | |
64 |
User | Count |
---|---|
208 | |
120 | |
113 | |
79 | |
72 |