Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hello, I bring a hard task, hope something can help me. I will explain the simple task on excel first.
I start with a simple table like the picture below:
With pivot tables I summarize the amount of purchase and the weights. And with those two tables I can estimate weighted average price and variance like in the following pictures.
In Power BI the weighted price it was faster to calculate, I just wrote the following measurement
Precio Prom. Pond. = sum(Tabla1[Purchase Amount])/sum(Tabla1[Weight])
Then, with a Matrix I obtain the same result for the weighted prices.
My problem is with the variance. How can I use a measurement's value for a vendor Like 0.67 (A,January) and subtract a measurement total like 0.47.
It is the same measurement but with different level of aggregations. I tried different formulas but without success.
The idea is that if you use slicer to filter dates or vendors the table change and the varices as well.
If somebody pass for something similar it will be great if you can share it. THANK!
Solved! Go to Solution.
Hi @opittaluga,
Based on my test, you should be able to use the formula below to create a measure to calculate total [Precio Prom. Pond.], and then use it in other calculations in your scenario.
Total Precio Prom. Pond. = CALCULATE ( SUM ( Table1[Purchase Amount] ) / SUM ( Table1[Weight] ), ALL ( Table1[Vendor] ) )
Measure = [Precio Prom. Pond.] - [Total Precio Prom. Pond.]
Regards
Hi @opittaluga,
Based on my test, you should be able to use the formula below to create a measure to calculate total [Precio Prom. Pond.], and then use it in other calculations in your scenario.
Total Precio Prom. Pond. = CALCULATE ( SUM ( Table1[Purchase Amount] ) / SUM ( Table1[Weight] ), ALL ( Table1[Vendor] ) )
Measure = [Precio Prom. Pond.] - [Total Precio Prom. Pond.]
Regards
Thank you! The formula works great.
Hello, I bring a hard task, hope something can help me. I will explain the simple task on excel first.
I start with a simple table like the picture below:
With pivot tables I summarize the amount of purchase and the weights. And with those two tables I can estimate weighted average price and variance like in the following pictures.
In Power BI the weighted price it was faster to calculate, I just wrote the following measurement
Precio Prom. Pond. = sum(Tabla1[Purchase Amount])/sum(Tabla1[Weight])
Then, with a Matrix I obtain the same result for the weighted prices.
My problem is with the variance. How can I use a measurement's value for a vendor Like 0.67 (A,January) and subtract a measurement total like 0.47.
It is the same measurement but with different level of aggregations. I tried different formulas but without success.
The idea is that if you use slicer to filter dates or vendors the table change and the varices as well.
If somebody pass for something similar it will be great if you can share it. THANK!