None of my averagex computations are working. To show my problem, I created 3 sample tables: a dimension table listing Salespersons, a CalendarDates table and a Sales facts table. Each salespers...
AverageX not working
v-cazheng-msft
4 years agoCommunity Support
Status changed:
New
to Investigating
Hi pgrandits
Measures' results are mainly impacted by the relationships and calculation context in your model. For AVERAGEX itself, it evaluates expressions for each row of a table, and then take the resulting set of values and calculate its arithmetic mean. Please try these measures instead of using AverageX.
AverageX Sales by Month =
VAR total_ =
CALCULATE ( SUM ( Sales[Sales] ), ALL ( Sales ) )
VAR count_month =
CALCULATE ( DISTINCTCOUNT ( CalendarDates[Date] ), ALL ( CalendarDates ) )
RETURN
total_ / count_month
AverageX Sales by Salesperson =
VAR total_ =
CALCULATE ( SUM ( Sales[Sales] ), ALL ( Sales ) )
VAR count_person =
CALCULATE ( DISTINCTCOUNT ( Salespersons[Name] ), ALL ( Salespersons ) )
RETURN
total_ / count_person
AverageX Sales by State =
var total_=CALCULATE( SUM(Sales[Sales]),ALL(Sales))
var count_state=CALCULATE(DISTINCTCOUNT(Salespersons[State]),ALL(Salespersons))
return total_/count_state
Best Regards,
Community Support Team _ Caiyun