Forum Discussion
Visual has exceeded the available resources
2 Replies
- amitchandak
Super User
eunji888888 , Try with these changes
claim2 =
VAR _date =SELECTEDVALUE('by SO'[InvoiceDate]) - 7
VAR netCaseSum =
SUMX(
VALUES('by SO'[BillingDocNo]),
CALCULATE(SUM('by SO'[*NetCase]))
)
VAR isInOOSList =
CALCULATE(
COUNTROWS('2024 OOS'),
FILTER(
'2024 OOS',
'2024 OOS'[InvoiceDate] = _date
&& NOT ISBLANK('2024 OOS'[#EAN])
)
) > 0
VAR scenario1 =
SUMX(
FILTER(
'by SO',
LEFT('by SO'[Reason Description], 2) <> "Gx"
),
'by SO'[*NetCase] * 'by SO'[number2]
)
RETURN
SWITCH(
TRUE(),
netCaseSum >= 2, scenario1,
netCaseSum = 1 && isInOOSList, scenario1,
netCaseSum = 1 && NOT isInOOSList, 0,
0
) - TomMartens
Super User
Hey eunji888888 ,
the below measure has two versions of DAX code,
ALLEXCEPT as iterator or calculate modifier = // SUMX( // ALLEXCEPT( 'FactOnlineSales' , 'FactOnlineSales'[ProductKey] ) // , FactOnlineSales[SalesAmount] // ) SUMX( 'FactOnlineSales' , CALCULATE( SUM('FactOnlineSales'[SalesAmount] ) , ALLEXCEPT( 'FactOnlineSales' , 'FactOnlineSales'[ProductKey] ) ) )the top one (commented) immediately raises the "... visual has exceeded the available resources" issue.
The bottom version looks similar and retrurns a result.Depending on the size of the fact table (I consider your table 'bySO' a fact table), the version at the top errors out immediately. It's very difficult to find a size of a table where this works, for this reason I recommend rewriting this part.
Hopefully, this provides some insights and will help to tackle your challenge.
Regards,
Tom