Forum Discussion
Query Exceeds
- Anonymous9 months ago
Hi SudhanshuD4512,
Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to Hans-Georg_Puls , kushanNa , syahmisi98 and amitchandak for prompt and helpful responses.
I’ve tried to reproduce the scenario using the M code below. Please review and adjust it according to your data source. If the issue still persists, feel free to share more details, and we’ll be happy to assist further.
Thanks & Regards,
Prasanna Kumar
Hii SudhanshuD4512
Your query exceeds because you are using a measure inside a calculated column, which forces Power BI to recalculate the entire measure for every row, creating a very expensive row-by-row evaluation. Calculated columns cannot depend on measures and this pattern always causes performance issues. Instead, put all logic in a measure only, for example B = IF([Measure] > 0, [Measure], 0), and remove the second calculated column. Measures calculate at query time and will not cause “query exceeds resources,” but calculated columns with measures will.
- SudhanshuD45129 months agoFrequent Visitor
I have tried that as well but same issue is there
- amitchandak9 months ago
Super User
SudhanshuD4512 , Unless this calculation has to change based on the visual row, you can have this as a row of a table, like
Change the calculated column like
A= Var _1 = IF ( ISBLANK('Fact'[Inv No]), 'Fact'[Amt],
IF (
'Fact'[account_id] = "AP",
'Fact'[local_amt],
'Fact'[local_amt] * -1
))
return IF(_1>0,_1,0)