Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have created a calculated column like this
A=
IF (
ISBLANK('Fact'[Inv No]),
'Fact'[Amt],
IF (
'Fact'[account_id] = "AP",
'Fact'[local_amt],
'Fact'[local_amt] * -1
)
)
After this i have created a measure on top of it Measure = SUM(A)
Now with using this i have to create other calculated column B like
B= IF(Measure>0,Measure,0)
But when I drag this in table query exceeds resources. I am not sure why this is happening
Hi @SudhanshuD4512,
Just following up to see if the Response provided was helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.
Best regards,
Prasanna Kumar
Hi @SudhanshuD4512,
Just following up to see if the Response provided was helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.
Best regards,
Prasanna Kumar
Hi @SudhanshuD4512,
Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @DNMAF , @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
Net Activity =
IF (
ISBLANK('Fact'[Inv No]),
'Fact'[Amt],
IF (
'Fact'[account_id] = "AP",
'Fact'[local_amt],
'Fact'[local_amt] * -1
)
)
Debit is calculated as if we sum net activity, if(net activity>0,net activity,0)
Credit if(net activity<0,net activity,0)*-1
| Inv Num | AccountID | Local Amount | Amt |
| 1000 | AP | 300 | 100 |
| 1000 | AP | -350 | 200 |
| 1000 | AP | 400 | 200 |
input
Output below i want
| Inv Num | AccountID | Net Activity | Debits | Credits |
| 1000 | AP | 350 | 350 | 0 |
Hi @SudhanshuD4512 ,
as @rohit1991 already mentioned a calculated column is something static it cannot depend on a measure that is something dynamic.
I created a sample data set using same column and table names you mentioned:
A measure that does your desired calculation should look like the following one:
Is it possible to get a sample PBIX file with the issue you are having? Maybe create a small table with test data and try to recreate the issue?
You’re using a measure inside a calculated column. That forces Power BI to evaluate the measure (which works in filter context) for every single row during refresh, and then again in visuals.
- Move your calculated column A to Power Query
- Create B as a measure instead of calculated column and then add the measure to your table
Did I answer your question? Mark my post as a solution! Appreciate your Kudos
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.
I have tried that as well but same issue is there
@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)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |