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
ramshoney1225
Helper V
Helper V

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.

 

ramshoney1225_0-1638248631451.png

 

Thanks,

 

 

7 REPLIES 7
v-rzhou-msft
Community Support
Community Support

Hi @ramshoney1225 ,

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.

1.png

Result:

2.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi @v-rzhou-msft 

 

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,

 

 

Hi @ramshoney1225 

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.

1.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

HI @v-rzhou-msft 

 

Thanks for your response and approach, Actually earlier we created a simple excel as the same and imported but it causing a problem - so we need to create it as a single Sort column that need to be come in single table.

so didnt follow that apporach.

 

whatever you shared is simillar apporach. Thanks for the update.

Can you help on the below another issue - which i'm not able to figure out , but made it as accept as solution from my end but its not working - i'm unable to make it as not solution.


https://community.powerbi.com/t5/Desktop/Selected-Value-and-IF-Else-statement-issue-Dynamic-Calculat...

 

 

 

ramshoney1225
Helper V
Helper V

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.

 

ramshoney1225_1-1638252021741.png

 

ramshoney1225
Helper V
Helper V

Hi @amitchandak 

 

Thanks for the quick response, i did the same but still throwing the same error with adding the newly created column

 

ramshoney1225_0-1638251390763.png

 

amitchandak
Super User
Super User

@ramshoney1225 , 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-c

sort

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.