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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
learner03
Post Partisan
Post Partisan

Circular dependency error

I have just one table and that contains a column sixe with sixes as- 2,8,4,6,M,L, 3XL etc. I need to sort them.  For this I created a new coloum called sortOrder and used an If condition-

SortOrder = IF(Table[Size (Apparel)]="2",1,IF(Table[Size (Apparel)]="4",2,IF(Table[Size (Apparel)]="6",3,IF(Table[Size (Apparel)]="8",4,IF(Table[Size (Apparel)]="10",5,.........Till all sizes till 38 sizes and  at last Table[Size (Apparel)]+38))))))
After that on Size coloumn I used sort by SortOrder-
akapoor03_0-1631859618893.png

But, it gives me below error( Blue is Table name-

akapoor03_1-1631859705817.png

 

How can I sort sizes in the form 0,2,4,6,8..S,M,L,Xl.2Xl...so on?

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@learner03 ,

 

Do it like this

 

refer: How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

 

Size (Apparel) 1 = [Size (Apparel)]

 

SortOrder = IF(Table[Size (Apparel)]="2",1,IF(Table[Size (Apparel)]="4",2,IF(Table[Size (Apparel)]="6",3,IF(Table[Size (Apparel)]="8",4,IF(Table[Size (Apparel)]="10",5,

//other

(Apparel)]+38))))))

 

then

sort : Size (Apparel) 1  on SortOrder

 

That will not give a circular error

 

 

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

1 REPLY 1
amitchandak
Super User
Super User

@learner03 ,

 

Do it like this

 

refer: How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

 

Size (Apparel) 1 = [Size (Apparel)]

 

SortOrder = IF(Table[Size (Apparel)]="2",1,IF(Table[Size (Apparel)]="4",2,IF(Table[Size (Apparel)]="6",3,IF(Table[Size (Apparel)]="8",4,IF(Table[Size (Apparel)]="10",5,

//other

(Apparel)]+38))))))

 

then

sort : Size (Apparel) 1  on SortOrder

 

That will not give a circular error

 

 

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.