Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
frank_gerritsma
New Member

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 5
v-xiaotang
Community Support
Community Support

Hi  @frank_gerritsma 

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.

Ashish_Mathur
Super User
Super User

Hi,

Does this work any better?

correctie_door_adviseur = COALESCE(CALCULATE(COUNTROWS('1_log_activiteit'),'1_log_activiteit'[activiteit] = 15
),0)

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ppm1
Solution Sage
Solution 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

Microsoft Employee
frank_gerritsma
New 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

VijayP
Super User
Super User

@frank_gerritsma 

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




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors