Forum Discussion
Yrstruly2021
Helper V
3 years agoOrder Value per Region
Please assist. I want to answer this question: "What is the average order value in the African Region per month?" My Data Model: pbix: https://drive.google.com/file/d/1pSb2n4sHm2yxhH_m79j0...
- 3 years ago
Hi Yrstruly2021
Thanks for reaching out to us.
please try this measure
Measure = var _nationkey=SELECTCOLUMNS( FILTER(REGION,REGION[R_NAME]="Africa"),"region name",[R_REGIONKEY]) var _customer= SELECTCOLUMNS( FILTER(CUSTOMER, CUSTOMER[C_NATIONKEY] in _nationkey),"custkey",[C_CUSTKEY]) var _orders= AVERAGEX(FILTER(ORDERS,ORDERS[O_CUSTKEY] in _customer),[O_TOTALPRICE]) return _ordersBest Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
v-xiaotang
Community Support
3 years agoHi Yrstruly2021
Thanks for reaching out to us.
please try this measure
Measure =
var _nationkey=SELECTCOLUMNS( FILTER(REGION,REGION[R_NAME]="Africa"),"region name",[R_REGIONKEY])
var _customer= SELECTCOLUMNS( FILTER(CUSTOMER, CUSTOMER[C_NATIONKEY] in _nationkey),"custkey",[C_CUSTKEY])
var _orders= AVERAGEX(FILTER(ORDERS,ORDERS[O_CUSTKEY] in _customer),[O_TOTALPRICE])
return _orders
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.