Forum Discussion
Inefficient DAX Formula - need assistance please
Hi all,
Just hoping to receive some assistance relating to a DAX formula that is causing a "Visual has exceeded the available resources" issue (seemingly due to inefficient formula).
In short, what is happening is I have two tables - one matrix which is the "summary" table, and one table that is the "detail" table.
The summary table has a list of names, and for this example, an average "contact time" and average "booking time". The detail table again has a list of names, further table details (i.e. create date, job no. etc) and the contact time and booking time. The issue I am facing is that when I filter a name on the summary table, the contact time (or booking time) does not load if that individiual only contacted or booked one of the events (i.e. person A contacted, person B booked). It simply returns a blank in one or the other column.. This is kind of expected, although I would like the time to show regardless.
The way I though about getting around this was removing the filter on the name if the result is a blank. This actually seemed to work for a split second, and then I received the error relating to available resources. This makes me believe the formula is quite inefficient - hoping to receive some tips!
The formula in question (contact time):
Thank you in advance 🙂
3.1 TIMETOCONTACT = COALESCE ( CALCULATE ( AVERAGE ( CONLINE2[CONTACTEDTIME] ), USERELATIONSHIP ( CONLINE2[EVENTREGUSER1100], EMPMASA2[EMF_USERID] ) ), CALCULATE ( AVERAGE ( CONLINE2[CONTACTEDTIME] ), USERELATIONSHIP ( CONLINE2[EVENTREGUSER1100], EMPMASA2[EMF_USERID] ), REMOVEFILTERS ( EMPMASA2[FULL NAME] ) ) )Not sure what else is going on in your data model but the relationships should be single directional.
Give it a whirl and see if this is any better. Note that I didn't touch 4.1 so you can compare.
Next step would be to fire up DAX Studio and test the queries against the actual data .
9 Replies
- lbendlin
Super User
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523- Mitchell92
Helper II
Hi lbendlin ,
Pbix file located here: Measure Simplification (Sample).pbix
It is working in this document due to the heavily stripped back dataset. Hence why I think a simpler measure will be the solution.
Thank you
- lbendlin
Super User
The highlighted columns are calculated columns, not measures. Please clarify.