Forum Discussion
Im getting error - Circular dependency was detected
Hi
I have a column "Concat TimePeriod", which have values below
January
Febuary
May
Febuary YTD
March YTD
September YTD
Data type i used for the below column is Wholenumber,Aggregation is Dont SUmmarize.
Month_rder = SWITCH('Table'[Concat TimePeriod],
"January",1,
"February",2,
"March",3,
"April",4,
"May",5,
"June",6,
"July",7,
"August",8,
"September",9,
"October",10,
"November",11,
"December",12,
"January YTD",13,
"February YTD",14,
"March YTD",15,
"April YTD",16,
"May YTD",17,
"June YTD",18,
"July YTD",19,
"August YTD",20,
"September YTD",21,
"October YTD",22,
"November YTD",23,
"December YTD",24 )
when i try to sort "Concat TimePeriod" column with "Month_Order" I'm getting below error.
Thanks,
7 Replies
- amitchandakSuper User
Anonymous , Create a new column
Concat TimePeriod 1= [Concat TimePeriod]
Use this new column in visual Concat TimePeriod 1, you can sort this on Month_rder
How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-csort
- AnonymousNot applicable
Hi amitchandak
Thanks for the quick response, i did the same but still throwing the same error with adding the newly created column
- AnonymousNot applicable
I tried with dummy excel file with data from Jan - Dec.
I created the same still its throwing error, i have did this for my previous work it didnt thrown anyerror but its very strange that now its throwing error.
- AnonymousNot applicable
Hi Anonymous ,
This error should be caused by your want to sort [Concat TimePeriod] column by [Month_rder] column which was created by dax based on [Concat TimePeriod] column.
There is a blog about this issue, your may refer to it for more details.
Here I suggest you to add an index column in Power Query then sort [Concat TimePeriod] column by index column.
Result:
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi Anonymous
Thanks for the response, I have gone through the blog which i'm not able to resolve the issue.
Understanding circular dependencies in DAX - SQLBI
When i create a Index column, then it will create a sequnece number for each row, but for me the index need to be created only for Concat TIme period, and this column value can be repeated many times so that the index number will be differnt with same Concat Time period column, which doesnt solve my issue.
Thanks,
- AnonymousNot applicable
Hi Anonymous
I think your problem is that you may have duplicate [Concat TIme period] or your Concat TIme period is not sort as you want in your table. Power Query doesn't have Switch function. Here I suggest you to try to add a conditional column in Power Query, then you can sort [Concat TIme period] by that custom column.
Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.