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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Easley08
Helper I
Helper 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_0-1703833154765.png

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super 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]
    )
)

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super 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]
    )
)

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

thanks it works i used this measure also but without the calculate thats why im getting the wrong total. 

@Easley08 

Yes, you need the CALCUALTE here to do the context-transition. 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.