Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills 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.
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.