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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Error : "A circular dependency was detected".

Hello Everyone,

 

I have a column in my table for "Country". To sort the countries in a specific way, i created another column by using below formula:

 

Country_Sort

                        SWITCH(TRUE(),
                         Table - Country] = "Canada",1 ,'Table' - [Country] = "USA",2, 'Table'- [Country] = "UK",3,'Table' - [Country] =                                 "Germany",4, 'Table' - [Country] = "AU",5,'Table' - [Country] = "NZ",6)
 
BUT  when i try to sort "Country" column in my table by using "Sort by column" option, i am getting below error:
Error : "A circular dependency was detected".
 
Need help to resolve above issue!!
 
Thanks !!
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,

 

Create a new column

Country 1= 'Table' - [Country] 

 

then

Country_Sort

                        SWITCH(TRUE(),
                         Table - Country] = "Canada",1 ,'Table' - [Country] = "USA",2, 'Table'- [Country] = "UK",3,'Table' - [Country] =                                 "Germany",4, 'Table' - [Country] = "AU",5,'Table' - [Country] = "NZ",6)
 
Sort Country1 on Country_sort and use country1

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
VijayP
Super User
Super User

@Anonymous 

 

When you create a Calculated column in the Report View you will get this error because the column which is created based a Column Cannot Sort the Same column because is Dependent on that Column (with a Formula).

 

Create a Custom column in Power Query Editor ,with the same logic and use that column for sorting . you will be successful

I am sure this will be a solution for  you and if so kindly share your Kudos and mark this as solution.

 

Regards

Vijay Perepa




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


amitchandak
Super User
Super User

@Anonymous ,

 

Create a new column

Country 1= 'Table' - [Country] 

 

then

Country_Sort

                        SWITCH(TRUE(),
                         Table - Country] = "Canada",1 ,'Table' - [Country] = "USA",2, 'Table'- [Country] = "UK",3,'Table' - [Country] =                                 "Germany",4, 'Table' - [Country] = "AU",5,'Table' - [Country] = "NZ",6)
 
Sort Country1 on Country_sort and use country1

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.