Forum Discussion

Raja10ram's avatar
Raja10ram
Helper I
1 year ago
Solved

Query Resources Exceeded Error

Hello Community Teams,

I am encountering the following error:
"Resources Exceeded: The query has exceeded the available resources. Try filtering to decrease the amount of data requested."

I believe the query is processing a large dataset. I’ve already tried adding filters, but the issue persists.

Could anyone suggest how to optimize the query further or manage resource limitations effectively? Any best practices for handling large datasets in this context would be greatly appreciated.

Thanks in advance for your help!

 

 

 

  • Hello Raja10ram ,

     

    you need to minimize the load, try removing complex measures from the table and make it in Power query.

  • Hi Raja10ram 

    The "Resources Exceeded" error in Power BI typically occurs when a query or its calculations consume more memory than the configured limit. Here are some strategies to optimize your query and manage resource limitations effectively:

     

    Simplify Your Query:

    • Review and simplify your query by removing unnecessary columns, filters, or transformations.
    • Ensure you're only loading the data needed for your report.

    Reduce Data Volume:

    • Filter your data to load only a subset, such as a specific date range or relevant categories.
    • Consider aggregating or summarizing data at the source level before importing it into Power BI.

    Optimize Data Model:

    • Use best practices for modeling your data, such as avoiding overly complex relationships and using role-playing dimensions.
    • Prefer calculated tables over calculated columns when possible.

     

    Hope this helps!!

    If this solved your problem, please accept it as a solution and a kudos!!

     

    Best Regards,
    Shahariar Hafiz

6 Replies

  • Hi Raja10ram 

    The "Resources Exceeded" error in Power BI typically occurs when a query or its calculations consume more memory than the configured limit. Here are some strategies to optimize your query and manage resource limitations effectively:

     

    Simplify Your Query:

    • Review and simplify your query by removing unnecessary columns, filters, or transformations.
    • Ensure you're only loading the data needed for your report.

    Reduce Data Volume:

    • Filter your data to load only a subset, such as a specific date range or relevant categories.
    • Consider aggregating or summarizing data at the source level before importing it into Power BI.

    Optimize Data Model:

    • Use best practices for modeling your data, such as avoiding overly complex relationships and using role-playing dimensions.
    • Prefer calculated tables over calculated columns when possible.

     

    Hope this helps!!

    If this solved your problem, please accept it as a solution and a kudos!!

     

    Best Regards,
    Shahariar Hafiz

  • Hello Raja10ram ,

     

    you need to minimize the load, try removing complex measures from the table and make it in Power query.

    • Raja10ram's avatar
      Raja10ram
      Helper I

      Hello Idrissshatila 

      Here,I didn't use any Complex measure just showing the Opening Value & Qty and Closing value & Qty which i am Showing the Stock Statement table.

  • I have been trying with this formulas to find out drawdown but when i am running the max dax function in the table its giving me the same value all over though i sort the date which is in date/time format. I am not understanding the reason why please help me out. I think its taking the max value directly what should i change to the running max ?

     

    DailyCumulativeProfit =
    CALCULATE(
        SUMX(
            FILTER(
                ALL(trade_logs),
                trade_logs[date] <= MAX(trade_logs[date]
                )
            ),
            trade_logs[pnl]
        )
    )
    which i am getting it correct
    then for 
    RunningMaxPnL =
    CALCULATE(
        MAXX(
            FILTER(
                ALL(trade_logs),
               trade_logs[date] <= MAX(trade_logs[date]
                )
            ),
            [DailyCumulativeProfit]
        )
    )
    • NimaiAhluwalia's avatar
      NimaiAhluwalia
      Continued Contributor

      [DailyCumulativeProfit] itself already uses ALL(trade_logs) inside, so when you call it inside another MAXX + ALL(trade_logs), the filter context gets overridden and you don’t get a row-by-row running max. Instead, you’re getting the same max value applied to the whole table.

      You need to calculate the running max cumulative profit over time by referencing the measure result per date, not recalculating it globally.

      RunningMaxPnL =
      VAR CurrentDate = MAX(trade_logs[date])
      RETURN
      CALCULATE(
      MAX([DailyCumulativeProfit]),
      FILTER(
      ALLSELECTED(trade_logs[date]),
      trade_logs[date] <= CurrentDate
      )
      )