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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sw123
Helper III
Helper III

Help with AVERAGEX

Hi,

 

I am trying to calculate acerage kg per day in Power BI, but can't get it to work. This is the formula I am trying:

 

Average / day = AVERAGEX(VALUES(Dates[Date]), [KG])

 

Where Date comes from my Date table and KG from my Production table. 

 

The error I get is: Column 'KG' cannot be found or may not be used in this expression.

 

Can someone help me calculate average kg / day?

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

Average / day =
AVERAGEX ( VALUES ( Dates[Date] ), CALCULATE ( SUM ( Production[KG] ) ) )

View solution in original post

3 REPLIES 3
Bibiano_Geraldo
Super User
Super User

Hi @sw123 ,

Make sure that this measure exists [KG], if not, create  a new one by this DAX:

Total KG = SUM(Production[KG])

And update your Averagex measure to this:

Average KG per Day = 
AVERAGEX(
    VALUES(Dates[Date]), 
    [Total KG]
)

 

johnt75
Super User
Super User

Try

Average / day =
AVERAGEX ( VALUES ( Dates[Date] ), CALCULATE ( SUM ( Production[KG] ) ) )

Thank you, this did the trick.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.