Forum Discussion
PBI ON REFRESH - 'The MAX function only accepts a column reference as the argument number 1.
- 1 year ago
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:
-
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. -
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]). -
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. -
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 LearnShould 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.
-
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