Forum Discussion
Easley08
2 years agoHelper I
not the same total while averaging
Hi,
is there a way to fix this currently i need to combine this measure into 1
the correct out put is Measure which is 64.9
currently im using variable to call the Measure
Finished Lead Cost ULAB = DIVIDE([ULAB Buying PHP/kg],AVERAGE(pb_percent[pb_ulab]),0)+SUM(raw_mats[ulab_php_conversion_cost_kg])-[Plastic Savings / kg]
Measure = AVERAGEX( VALUES('Calendar Table'[Date]),[Finished Lead Cost ULAB])
Finished Lead Cost ULAB1 =
Var Finished Lead Cost ULAB = DIVIDE([ULAB Buying PHP/kg],AVERAGE(pb_percent[pb_ulab]),0)+SUM(raw_mats[ulab_php_conversion_cost_kg])-[Plastic Savings / kg]
var Measure = AVERAGEX(VALUES('Calendar Table'[Date]),Finished Lead Cost ULAB )
RETURN
Measure
why im getting the wrong total when im just using the variable.
Easley08
You cannot use a variable (ans) inside an interation as the variable once assigned behaves like a constant.
Use this meaure:Finished Lead Cost ULAB1 = AVERAGEX ( VALUES ( 'Calendar Table'[Date] ), CALCULATE ( DIVIDE ( [ULAB Buying PHP/kg], AVERAGE ( pb_percent[pb_ulab] ), 0 ) + SUM ( raw_mats[ulab_php_conversion_cost_kg] ) - [Plastic Savings / kg] ) )
3 Replies
- FowmySuper User
Easley08
You cannot use a variable (ans) inside an interation as the variable once assigned behaves like a constant.
Use this meaure:Finished Lead Cost ULAB1 = AVERAGEX ( VALUES ( 'Calendar Table'[Date] ), CALCULATE ( DIVIDE ( [ULAB Buying PHP/kg], AVERAGE ( pb_percent[pb_ulab] ), 0 ) + SUM ( raw_mats[ulab_php_conversion_cost_kg] ) - [Plastic Savings / kg] ) )