Forum Discussion
Use AVERAGEX with two arguments for KEEPFILTERS
Hey All,
I have a problem that should be very simple to solve - and I know two possible workarounds (see below) - but maybe there is a better way with the correct usage of the DAX-power 😉
My situation:
I have a table that contains all the order_details (positions) of all orders with columns like 'order-nr', 'product-nr', etc.
I was creating some AVERAGEX measures for my report and it works fine, as long as I have only one condition/argument for the KEEPFILTERS part.
Example:
Do I have to 'outsource' the KEEPFILTER part with different Variables and use the older 'FILTER...ALL' possibilities of DAX?
Or would it be better to optimize my data and include a new column with is combining 'product-name' and 'color' to get a 'product-version' kind of column?
backflash you can use summarize
AVERAGEX( SUMMARIZE ( 'Order_details','order_details'[productname],'order_details'[product_color]), CALCULATE(SUM('order_details'[order_amount])) )✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
3 Replies
- parry2k
Super User
backflash you can use summarize
AVERAGEX( SUMMARIZE ( 'Order_details','order_details'[productname],'order_details'[product_color]), CALCULATE(SUM('order_details'[order_amount])) )✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
- parry2k
Super User