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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
db042190
Post Prodigy
Post Prodigy

circular reference in sorting year descending

hi, i just entered this new column.  When i went to the modeling selection (left under data) and chose sort order for XYear, I got an error saying that i had created a circular reference from XYear to Rank to Xyear.  How do i get around that?

 

Rank = RANKX('mytable','mytable'[XYear],,DESC,Dense)  
 
While the images dont show there, i got the pproach from https://community.powerbi.com/t5/Desktop/Sort-Matrix-by-Year-descending/m-p/886303  
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@db042190 , Create two columns

XYear1 = [XYear]

Rank = RANKX('mytable','mytable'[XYear],,DESC,Dense)

 

Then sort XYear1 on rank and use XYear1 in the visual

 

 

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

 

 

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

v-luwang-msft
Community Support
Community Support

Hi @db042190 ,

A circular dependency is detected whenever two objects reference each other, in such a way that Power BI cannot process the objects. 

Based on my research, there are normally two ways to solve the circular dependency issue:

  • Add the row identifier column to one of your fact tables, then create corresponding relationships with other fact tables.
  • Use ALLEXCEPT to remove the calculated columns from the set of columns that become part of the dependency list is a viable option.

For more details about the circular dependency issue, you can refer to this article.

 

And you also could refer the following article:

https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/ 

 

Did I answer your question? Mark my post as a solution!And if question not solved ,could you share your sample data?


Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @db042190 ,

A circular dependency is detected whenever two objects reference each other, in such a way that Power BI cannot process the objects. 

Based on my research, there are normally two ways to solve the circular dependency issue:

  • Add the row identifier column to one of your fact tables, then create corresponding relationships with other fact tables.
  • Use ALLEXCEPT to remove the calculated columns from the set of columns that become part of the dependency list is a viable option.

For more details about the circular dependency issue, you can refer to this article.

 

And you also could refer the following article:

https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/ 

 

Did I answer your question? Mark my post as a solution!And if question not solved ,could you share your sample data?


Best Regards

Lucien

amitchandak
Super User
Super User

@db042190 , Create two columns

XYear1 = [XYear]

Rank = RANKX('mytable','mytable'[XYear],,DESC,Dense)

 

Then sort XYear1 on rank and use XYear1 in the visual

 

 

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

 

 

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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.