Forum Discussion
Anonymous
3 years agoNot applicable
Make DAX formula more efficient
Hi,
I have created a DAX formula that works in logic. However, when I run it, the error message appears:
"There is not enough memory available to perform this operation. Try again later when more memory may be available."
The problem is with the DAX formula and I would like to make it more efficient. Would it be enough to add a date filtering or does anyone see a concrete improvement possibility to make the DAX formula run faster?
DAX formula:
OrdersZSOPA1 = IF( ISBLANK( CALCULATE(max('Sales Invoice Line'[Artikel]),(ALLEXCEPT('Sales Invoice Header','Sales Invoice Header'[Auftrag MCS])),'Sales Invoice Line'[Artikel]="ZSOPA")),1,0)
Thank you very much for your help.
Anonymous Couple things to try:
OrdersZSOPA1 = VAR __MCS = DISTINCT('Sales Invoice Header'[Auftrag MCS]) VAR __Table = FILTER('Sales Invoice Line',[Artike] = "ZSOPA" && [Auftrag MCS] IN __MCS) VAR __Count = COUNTROWS(__Table) + 0 RETURN IF(__Count = 0, 1, 0) // assumes headers table is connecte via a column called Auftrag MCS or try something like: OrdersZSOPA1 = VAR __Table = CALCULATETABLE( 'Sales Invoice Line', ALLEXCEPT('Sales Invoice Header','Sales Invoice Header'[Auftrag MCS]), 'Sales Invoice Line'[Artikel]="ZSOPA" ) VAR __Count = COUNTROWS(__Table) + 0 RETURN IF(__Count = 0, 1, 0)
5 Replies
- Greg_DecklerCommunity Champion
Anonymous How many rows of data are you dealing with here?
- AnonymousNot applicable
Greg_Deckler about 700k
- AnonymousNot applicable
Greg_Deckler Do you have an idea to simplify the DAX formula?