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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Coolpearl
Regular Visitor

Alternative to countrows-filter-values calculation

I have below calculations in some fields which take time to run. I am looking for alternative for same to improve performance. 
measure = 

if( 

     countrows( filter( values( 'emptable'[type])' , 'emptable'[type] = "retired" ) )  > 0,

         Calculate( [measure_counted] , 'emptable'[type] = "retired" ), 0 

)

 

in above, 'filter' is affecting performance. 

Plz suggest alternative if any. Thanks.

6 REPLIES 6
Anonymous
Not applicable

Hi @Coolpearl 
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

Anonymous
Not applicable

Hi @Coolpearl 
I wanted to check if you had the opportunity to review the information provided by @Ashish_Mathur , @amitchandak  and @Deku . Please feel free to contact us if you have any further questions. If their response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

Anonymous
Not applicable

Hi @Coolpearl 
Thank you for reaching out microsoft fabric community forum.

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

Ashish_Mathur
Super User
Super User

Hi,

Try this

Measure = coalesce(Calculate( [measure_counted] , 'emptable'[type] = "retired" ),0)


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Coolpearl , Try like

 

Calculate( [measure_counted] , filter( 'emptable', 'emptable'[type] = "retired" )) +0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Deku
Super User
Super User

This might be better

 

If(

"Retired" in values( 'emptable'[type])',

Calculate(

[measure_counted] ,

'emptable'[type] = "retired"

), 0

)

 

If you know the [measure_counted] will not return a result if filter by retired, and there are no retired

 

Var result = Calculate(

[measure_counted] ,

'emptable'[type] = "retired"

)

Return 

If( isblank( result ), result, 0)


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.