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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
FabricNZ
Helper I
Helper I

PBI ON REFRESH - 'The MAX function only accepts a column reference as the argument number 1.

Hi there,

Error returned: 'The MAX function only accepts a column reference as the argument number 1. Column 'Total' cannot be found or may not be used in this expression.

On refresh I get this error - no red alerts on any measure. Exported to PBIP and looked for all files in project that have max and total in the same line but can't find anything. I looked through all my MAX functions and they look alright.  How do I pinpoint which one is throwing this issue?

 

I then get all sorts of out of memory issues after this.

Thank you!

1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Thankyou, @Ritaf1983, for your response.

Hi FabricNZ,

We appreciate your inquiry on the Microsoft Fabric Community Forum.

From my understanding, the error message indicates an incorrect DAX syntax involving the use of MAX(<expression>), where MAX is applied to a scalar or measure instead of a column reference. This issue does not appear in visuals, is not flagged within Power BI Desktop, and only occurs during Semantic Model refresh. This suggests that the problem likely lies within a calculated column, calculated table, or a hidden expression within the model.

Moreover, the memory overflow indicates that a complex or improperly scoped calculation — possibly recursive or involving a very large row context — is attempting to process extensive datasets during the refresh.

Kindly follow the steps below to help resolve this issue:

  1. The error is caused by using MAX() with a measure or a missing column (for example, [Total]). Since this is not evident in the UI, you can locate the erroneous MAX usage by:
    a. Opening your .pbip project folder.
    b. Navigate to expressions.json. Search for MAX( and Total. You will likely find a broken expression such as MAX([Total]), where [Total] is not a column.

  2. Ensure that MAX() is used exclusively with column references to correct the DAX expression.
    The expression MAX([Total]) — if [Total] is a measure or a deleted column — is incorrect. The correct usage should be MAX(Sales[TotalAmount]).

  3. To avoid memory overflow issues, apply the following changes:
    a. In Power Query, apply row filters such as Table.SelectRows(Source, each [Date] >= #date(2024,1,1]) and use Table.FirstN(Source, 100) for testing purposes.
    b. Disable Auto Date/Time from File > Options > Data Load.
    c. Remove unused columns and tables, and disable table load if not required.

  4. Test the changes in Power BI Desktop, re-publish to Power BI Service / Fabric, and re-enter the data source credentials. If memory limits persist, request a per-query memory increase from the capacity administrator (applicable for Premium/Fabric SKUs).

Additionally, please refer to the following links for further information:
MAX function (DAX) - DAX | Microsoft Learn
Optimization guide for Power BI - Power BI | Microsoft Learn

Should you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members who face similar issues.

For any further queries, please feel free to contact the Microsoft Fabric community.

Thank you.

View solution in original post

6 REPLIES 6
FabricNZ
Helper I
Helper I

Thanks all for your response.  I started a fresh and rebuilt the dashboard using TDML, etc in a few hours and it works again.  I did find the total error.  The MAX has disappeared.  I feel there was something corrupt within the workbook as the same joins and queries are there again. All very strange and unusual. The problem is too I can't on some pages restrict the date on initial load or filters as the page represents historical trends for which I need the full data.  Thank you all again. Whilst no one solution helped, the ideas did.

v-pnaroju-msft
Community Support
Community Support

Thankyou, @Ritaf1983, for your response.

Hi FabricNZ,

We appreciate your inquiry on the Microsoft Fabric Community Forum.

From my understanding, the error message indicates an incorrect DAX syntax involving the use of MAX(<expression>), where MAX is applied to a scalar or measure instead of a column reference. This issue does not appear in visuals, is not flagged within Power BI Desktop, and only occurs during Semantic Model refresh. This suggests that the problem likely lies within a calculated column, calculated table, or a hidden expression within the model.

Moreover, the memory overflow indicates that a complex or improperly scoped calculation — possibly recursive or involving a very large row context — is attempting to process extensive datasets during the refresh.

Kindly follow the steps below to help resolve this issue:

  1. The error is caused by using MAX() with a measure or a missing column (for example, [Total]). Since this is not evident in the UI, you can locate the erroneous MAX usage by:
    a. Opening your .pbip project folder.
    b. Navigate to expressions.json. Search for MAX( and Total. You will likely find a broken expression such as MAX([Total]), where [Total] is not a column.

  2. Ensure that MAX() is used exclusively with column references to correct the DAX expression.
    The expression MAX([Total]) — if [Total] is a measure or a deleted column — is incorrect. The correct usage should be MAX(Sales[TotalAmount]).

  3. To avoid memory overflow issues, apply the following changes:
    a. In Power Query, apply row filters such as Table.SelectRows(Source, each [Date] >= #date(2024,1,1]) and use Table.FirstN(Source, 100) for testing purposes.
    b. Disable Auto Date/Time from File > Options > Data Load.
    c. Remove unused columns and tables, and disable table load if not required.

  4. Test the changes in Power BI Desktop, re-publish to Power BI Service / Fabric, and re-enter the data source credentials. If memory limits persist, request a per-query memory increase from the capacity administrator (applicable for Premium/Fabric SKUs).

Additionally, please refer to the following links for further information:
MAX function (DAX) - DAX | Microsoft Learn
Optimization guide for Power BI - Power BI | Microsoft Learn

Should you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members who face similar issues.

For any further queries, please feel free to contact the Microsoft Fabric community.

Thank you.

Thank you - whilst no direct solution it gave me some ideas 🙂  I had the date/time thing disabled prior.  Interesting was I found [TOTAL] in measure, but not MAX with total in it.  Odd.  I rebuilt the dashboard and it worked again. I have had issues with this in terms of lineage of tables from the semantic model as well, so I just bit the bullet and rebuilt.  Thanks!!!

FabricNZ
Helper I
Helper I

I can't find the MAX function.  I am using MAX a bit, but I can't narrow down the right one. They all use columns in existence. The sementic model errors with same when I refresh that in fabric. Can't increase capacity. Have lowered PBI parallel streams and memory.  Performance analyzer does not show. Must be outside of visuals if it happens in Semantic model refresh.  My questions would be:

* How to specifically find the MAX in issue without trial and error

* Is there any way to restrict the data to say 100 rows on a refresh without say hitting the data warehouse and looking through millions of rows?  Can this be done in PBI desktop?  I did try a refresh with filters, but no.

* I'll keep looking throgh my PB* files for MAX.

 

Failed to save modifications to the server. Error returned: 'The MAX function only accepts a column reference as the argument number 1. OLE DB or ODBC error: Resource Governing: This query uses more memory than the configured limit. The query — or calculations referenced by it — might be too memory-intensive to run. Either simplify the query or its calculations, or if using Power BI Premium, you may reach out to your capacity administrator to see if they can increase the per-query memory limit. More details: consumed memory 10326 MB, memory limit 10240 MB. See

FabricNZ
Helper I
Helper I

Thank you for the information.  There are no errors in the PBIX next to any measures.  I looked at the PB files and can't find anything with [Total] in it.  I'll work through the below and see where I get to and will mark as a solution if I find something.  Thank you so much for your guidance.

Ritaf1983
Super User
Super User

Hi @FabricNZ 

The error indicates that a MAX() function is being used incorrectly—most likely with a scalar value or measure instead of a column. There's also a reference to a 'Total' column that seems to be missing from the model.

Here are some steps to help you debug:

 Debugging suggestions:

  1. Refresh from Power BI Desktop – it often provides more specific error messages than the Service.

  2. Check for issues in the model:

    • Look for any measures or calculated columns with a warning ! icon.

    • Search for [Total] or MAX inside DAX formulas.

  3. If you're using Visual Calculations (preview feature), check if any logic there depends on visuals. Errors in visual calcs only appear when a visual renders.

  4. Use Performance Analyzer to identify which visual triggers the error.

  5. Search the PBIP or PBIT files using a text editor for any MAX or Total references.

  6. Review recent changes – especially any updates to measures or visuals that may have used a deleted or renamed column.

If none of the above helps, consider opening a support ticket with Microsoft—especially if you’re also encountering memory issues afterward.

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

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.