Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
MrBlueSky2
Frequent Visitor

Query has exceeded available resources

Hi all,

I try to filter a table based on a field parameter value to show only the rows with margin below the selected value. 

The regular filter visual does not allow to use a field parameter but only hard coded values.

So I tried to use a calculated column with a true/false based on the field parameter but it only compares to the default value, I assume it is assessed only at table load

I tried then to create a measure with true/false based on the field parameter however I get the error "the query has exceeded the available resources"

Even when I add the field parameter to the table I get this error, it is simply a scalar value so I don't understand why the engine is getting stuck with this. I even tried to create a measure with a constant value "1" and add it to the table and I get the same error.

Any help with this?

BR

1 ACCEPTED SOLUTION

Thanks for your help both, unfortunately suggested solutions don't work but I found a way to fix it. I created a measure with a IF that returns 1 or 0 based on the parameter and a recalculated margin within a SUMX instead of using the precalculated margin field.

It works now, the new formula is more complex but for some reason uses less resources

View solution in original post

5 REPLIES 5
Poojara_D12
Super User
Super User

Hi @MrBlueSky2 

Please try using the below DAX:

IsBelowSelectedMargin = 
IF(
    MAX('Table'[Margin]) < SELECTEDVALUE('Field Parameter Table'[Field Parameter]),
    1, 
    0
)

 

 

  • Reduce table size in Power Query.
  • Simplify DAX formulas.
  • Ensure correct relationships between tables.

fabric-community-super-user-fy24-25.png

 

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
Kedar_Pande
Super User
Super User

@MrBlueSky2 

Create a Measure:

FilterMeasure = 
IF(
SELECTEDVALUE('YourFieldParameterTable'[FieldParameter]) > 0 &&
MAX('YourTable'[Margin]) < SELECTEDVALUE('YourFieldParameterTable'[FieldParameter]),
1,
0
)

Add this measure to your visual and set the filter to FilterMeasure = 1

If performance issues persist, simplify your data model or reduce the visual complexity by pre-aggregating data.

 

💡 If this helped, please give Kudos 👍 or mark it as a Solution .
Best regards,
Kedar
🌐 Connect on LinkedIn
Sahir_Maharaj
Super User
Super User

Hello @MrBlueSky2,

 

Instead of calculating True/False for each row dynamically with a measure, you can rewrite your measure to focus only on filtering the rows:

Filter Measure = 
VAR SelectedMargin = SELECTEDVALUE(FieldParameterTable[FieldParameter])
RETURN
    IF( MAX(TableName[Margin]) < SelectedMargin, 1, 0 )

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Thanks for your help both, unfortunately suggested solutions don't work but I found a way to fix it. I created a measure with a IF that returns 1 or 0 based on the parameter and a recalculated margin within a SUMX instead of using the precalculated margin field.

It works now, the new formula is more complex but for some reason uses less resources

Hi @MrBlueSky2 

 

Thank you very much Kedar_Pande and Sahir_Maharaj for your prompt reply.

 

I'm glad to hear you found a solution! It sounds like using the SUMX function with a recalculated margin and an IF statement was the key. Sometimes, more complex formulas can indeed be more efficient, depending on how they interact with the data model and the engine's optimization.

 

You can accept it as a solution, which will help to help more people understand the problem.

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.