Forum Discussion
sw123
1 year agoHelper 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?
Try
Average / day = AVERAGEX ( VALUES ( Dates[Date] ), CALCULATE ( SUM ( Production[KG] ) ) )
3 Replies
- johnt75Super User
Try
Average / day = AVERAGEX ( VALUES ( Dates[Date] ), CALCULATE ( SUM ( Production[KG] ) ) )- sw123Helper III
Thank you, this did the trick.
- Bibiano_GeraldoSuper 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] )