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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
mp390988
Post Patron
Post Patron

SELECTCOLUMNS function

Hi,

 

Is it not possible to include a calculated column from another table in the SELECTCOLUMNS function?

So for example, in table A I have a calculated column,

Then I am creating a new table using the SELECTCOLUMNS function where I am trying to reference the calculated column from table A but it is giving me an error saying circular reference.

3 ACCEPTED SOLUTIONS
AmiraBedh
Super User
Super User

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.


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

Shahid12523
Community Champion
Community Champion

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.

Shahed Shaikh

View solution in original post

HarishKM
Memorable Member
Memorable Member

@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.

View solution in original post

6 REPLIES 6
mp390988
Post Patron
Post Patron

Thank you all for responding, it has been helpful.

FBergamaschi
Solution Sage
Solution Sage

The answer depends onthe code you are writing, we cannot answer in general as in principle you can do it

 

If you can share the code and a small sibset of the rows of the tables involved, we can help you

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

HarishKM
Memorable Member
Memorable Member

@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.

Shahid12523
Community Champion
Community Champion

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.

Shahed Shaikh
AmiraBedh
Super User
Super User

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.


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
alish_b
Resolver III
Resolver III

Hello @mp390988 ,

 

No, Power BI will not allow to directly reference a calculated column in the definition of another table using SELECTCOLUMNS. This is mainly because of the fact that when Power BI refreshes a table it will compute the rows step by step, and so if the columns are not ready in the original table, they cannot be referenced in the secondary table. The easiest workaround will be to recreate the logic in ADDCOLUMNS or SELECTCOLUMNS itself. 

 

Hope it helps!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors