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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
elaj
Helper IV
Helper IV

DAX to create a sort column without having ring dependency problem

Hi guys,

 

i try to sort a column by a DAX calculated column wich references the column wich i want to sort.

therefore i get a ring dependency problem.

 

My workaround would be to copy the column and sort it by the sort column.

But i create a lot of copied data if i do so. Do you have another approach for doing that?

 

My code to calculate the sortcolumn:

 

image.png

 

and now i want to sort F5c by F5c_lbl_sort:

 

image.png

 

but i get the ring dependency problem.

 

Is there somehow the possibility to change the DAX formula that i will not get the ring dependency problem?

Or is it maybe easier to calculate the F5c_lbl_sort column in the query editor? I think then i dont have the dependency thing

 

thanks for your answers.

here the pbix

 

 

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @elaj,

I think this dependency issue is caused by using the raw field in other fields calculated and invoke this calculated field on raw field operations. (if you keep this scenario, I don't think you can prevent dependency issue appears)

Perhaps you can try to create a new table to extract these fields(use all to extract) and apply custom sorting on new table and link to raw table fields to enable custom sorting.

Custom Sorting in Power BI 

BTW, you can take a look at below blog to know more about circular dependency issue: 

Avoiding circular dependency errors in DAX 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@elaj , you can not use F5c  in F5c_lbl_sort calculation.

You are checking for blank.

Try if you can create a copy of this column in power query and that can help

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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