Forum Discussion
Slow Running Dax Measure
Is someone able to tell me why the below dax measure runs painfully slow? I'm trying to identify the customers (identifier being the BasketID in the sales table) who only purchased 1 product:
Slow Measure:
- Anonymous6 years ago
Hi Anonymous ,
How about create or var a calculated table and filter the calculated table instead like:
Transactions (Selected Product) Bought 1 Unit = var tmptable = SUMMARIZE( Sales, Sales[BasketID], "Total Units Purchased", [Units Sold (Selected Product)] ) return CALCULATE( [Transactions (Selected Product)], FILTER( tmptable, [Total Units Purchased] = 1 ) )Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- Greg_DecklerCommunity Champion
First thing that stands out, it is weird to use a SUMMARIZE in a FILTER. Not saying it is wrong, just not common. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- AnonymousNot applicable
Hi Anonymous ,
How about create or var a calculated table and filter the calculated table instead like:
Transactions (Selected Product) Bought 1 Unit = var tmptable = SUMMARIZE( Sales, Sales[BasketID], "Total Units Purchased", [Units Sold (Selected Product)] ) return CALCULATE( [Transactions (Selected Product)], FILTER( tmptable, [Total Units Purchased] = 1 ) )Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Thank you so much! this worked perfectly!