Forum Discussion
Measures not efficient
hi,
I use two measures (below).
Table 1_log_activiteit contains 600K rows.
Is there a way to make the measures more efficient?
Currently the desktop application stalls when I use them in a table.
correctie_door_adviseur = CALCULATE(COUNTROWS('1_log_activiteit'), FILTER('1_log_activiteit', '1_log_activiteit'[activiteit]=15))+0
correctie_door_adviseur_doorlooptijd = CALCULATE(SUM('1_log_activiteit'[doorlooptijd]), FILTER('1_log_activiteit', '1_log_activiteit'[activiteit]=15))+0
5 Replies
- VijayPCommunity Champion
Avoid writting CALCULATE (COUNTROWS()),
First create a measure with COUNTROWS() and stage that measure in another measure with CALCULATE. It will unnecessary Filter context! Try and let me know
- frank_gerritsmaNew Member
Hmm, this did not solve the issue.
Any thoughts?
acties_per_bestelling = COUNTROWS('1_log_activiteit')
correctie_door_adviseur = CALCULATE([acties_per_bestelling], FILTER('1_log_activiteit', '1_log_activiteit'[activiteit]=15))+0
- ppm1Solution Sage
It is not good practice to filter an entire table in your CALCULATE (best to do only one column at a time). It is also not good to add +0. See this article How to return 0 instead of BLANK in DAX - SQLBI, and try this measure instead.
correctie_door_adviseur = CALCULATE ( COUNTROWS ( '1_log_activiteit' ), '1_log_activiteit'[activiteit] = 15 )Pat
- Ashish_MathurSuper User
Hi,
Does this work any better?
correctie_door_adviseur = COALESCE(CALCULATE(COUNTROWS('1_log_activiteit'),'1_log_activiteit'[activiteit] = 15 ),0) - v-xiaotangCommunity Support
Thanks for reaching out to us.
I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.
If you need more help, please let me know.
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.