Forum Discussion
SELECTCOLUMNS function
- 11 months ago
Hello !
Your circular reference error means the new calculated table you’re building depends on Table A[Calculated column] and directly or indirectly that calculated column or something it uses depends back on the new table (or on something that depends on it). DAX won’t allow cycles in the dependency graph at refresh time.
My assumptions :
-
Table A[Calculated column] uses LOOKUPVALUE, RELATED, RELATEDTABLE, or a something that reads from the new table or a table built from it
-
You add a relationship and then a calc column on A that uses RELATED(NewTable[…]) while NewTable is built from A → A ↔ NewTable loop.
-
A measure inside the calc column references NewTable or virtual tables that rely on NewTable.
If you share your code I can help you.
-
- 11 months ago
You can't use a calculated column from another table in SELECTCOLUMNS if it creates a circular dependency. Instead, use a measure, move the logic to Power Query, or redesign the model to avoid indirect references. Measures are safer because they don’t rely on row context.
- 11 months ago
mp390988 Hey,
In DAX, when using the SELECTCOLUMNS function to create a new table, directly referencing a calculated column from another table can result in a circular reference error if the calculated column itself depends on the data in the new table or vice versa. This happens because DAX evaluates dependencies to ensure data integrity and avoids situations where a calculation could reference itself indirectly, causing an infinite loop.
To resolve this, ensure that the calculated column in the original table is independent of the new table or consider using measures or variables to avoid direct dependencies.Thanks
Harish M
Give kudos if this solution resolves the issue.
Accept it as the solution if it helps.
You can't use a calculated column from another table in SELECTCOLUMNS if it creates a circular dependency. Instead, use a measure, move the logic to Power Query, or redesign the model to avoid indirect references. Measures are safer because they don’t rely on row context.