Performance question based on Dax change

Below is a measure I that I have put together that works with not issues other than sometimes it returns “Blank” when there is no data to return.

Customer Misc Amount =
VAR miscCalc =
CALCULATE (
SUM ( ‘Service Ledger Entries’[Amount] ) * -1,
FILTER (
‘Service Ledger Entries’,
‘Service Ledger Entries’[Resource Type] = “Service Cost”
&& ‘Service Ledger Entries’[Customer Number]
= SELECTEDVALUE ( Customers[Customer Number] )
&& ( ‘Service Ledger Entries’[Service Order Type] = “PM”
|| ‘Service Ledger Entries’[Service Order Type] = “FLD”
|| ‘Service Ledger Entries’[Service Order Type] = “ABU”
|| ‘Service Ledger Entries’[Service Order Type] = “CDMG” )
)
)
RETURN
miscCalc

To handle the Blank value being returned, I added the following If statement.

RETURN
IF(ISBLANK(miscCalc),0,miscCalc)

The issue I am having is, after added this If statement, my performance goes way way down. I take out the If statement and it is very fast again.

Any thoughts?

@lomorris,

Try

RETURN
COALESCE (miscCalc, 0) and see if that performs significantly better.

  • Brian

I was hoping to say yes that worked, but no. I am going use Dax Studio to see if I can figure out what the issue is.

@lomorris,

My other suggestion would be to submit it to The Optimization Lab, and have it analyzed in depth by the master @AntrikshSharma.

  • Brian

That sounds like a great ideal!

Thanks Brian, I will do that.

@lomorris,

If you haven’t yet seen the first Optimization Lab video he did last month, I can’t recommend it highly enough - it is an absolute master class:

  • Brian

I’m on it. Thanks Brian.

Hi @lomorris, did the response provided by @BrianJ help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query. Thanks!

Hi @lomorris, we’ve noticed that no response has been received from you since the 22nd of April. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.

Hi @lomorris, due to inactivity, a response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box.

We’ve recently launched the Enterprise DNA Forum User Experience Survey, please feel free to answer it and give your insights on how we can further improve the Support forum. Thanks!