Forum Discussion

elaj's avatar
elaj
Helper IV
6 years ago

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:

 

 

and now i want to sort F5c by F5c_lbl_sort:

 

 

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

  • 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

  • Anonymous's avatar
    Anonymous
    Not applicable

    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