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.
-
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:
-
Refresh from Power BI Desktop – it often provides more specific error messages than the Service.
-
Check for issues in the model:
-
Look for any measures or calculated columns with a warning
!icon. -
Search for
[Total]orMAXinside DAX formulas.
-
-
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.
-
Use Performance Analyzer to identify which visual triggers the error.
-
Search the PBIP or PBIT files using a text editor for any
MAXorTotalreferences. -
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