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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
PranavR
New Member

A circular dependency was detected

I have a table SalesAnalysis, in which I have 4 columns - Year, Month, Day,WeekNo.
In this table I have 2 type - Monthly and Weekly.
For Monthly data I get values for Year, Month,Day columns, and for Weekly data I get values for Year, WeekNo.

I need to create a relationship between this table and Date master. 
I created a calculated column in the SalesAnalysis table for Monthly_Dt for monthly data and Weekly_Dt for weekly data and combined them in another calculated column Date, where I added the type filter.

DAX -

Monthly_Dt = IF(ISBLANK('SalesAnalysis'[Month]) || ISBLANK('SalesAnalysis'[Day]),BLANK(),DATE(VALUE('SalesAnalysis'[Jahr]),VALUE('SalesAnalysis'[Month]),VALUE('SalesAnalysis'[Day])))

Weekly_Dt

CALCULATE(max('Dim Calendar'[Date]),FILTER('Dim Calendar','Dim Calendar'[YearWeek]='SalesAnalysis'[YearWeek]))


Date

IF('SalesAnalysis'[Type]="Monthly", 'SalesAnalysis'[Monthly_Dt],IF('SalesAnalysis'[Type]="Weekly",'SalesAnalysis'[Weekly_Dt],BLANK()))
 
 

But when I'm trying to create a relationship, I'm getting below error - 

A circular dependency was detected: SalesAnalysis[Weekly_Dt], 2d4d65ad-ef12-2dd7-823a-
6b8a1e2b983f, SalesAnalysis[Date], SalesAnalysis[Weekly_Dt].

1 ACCEPTED SOLUTION

Hi @PranavR ,
Thanks for reaching out to the Microsoft fabric community forum. 


Please go through the below documents which may help you in resolving the issue:

FIX CIRCULAR DEPENDENCY ERROR / 2 Common Scenarios and how to fix them / Beginners Guide to Power BI
Solved: Need Help in Resolving Circular Dependency - Microsoft Fabric Community
Solved: Circular dependency - Microsoft Fabric Community

If I misunderstand your needs or you still have problems on it, please feel free to let us know.   

Best Regards, 
Menaka.
Community Support Team  



View solution in original post

7 REPLIES 7
v-menakakota
Community Support
Community Support

Hi @PranavR ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

Hi @v-menakakota,
This doesn't resolve the problem. Our Date dimension is in DAX, so it's not available in Power Query.

Hi @PranavR ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster. 

 

Thank you. 

Hi @PranavR ,
Thanks for reaching out to the Microsoft fabric community forum. 


Please go through the below documents which may help you in resolving the issue:

FIX CIRCULAR DEPENDENCY ERROR / 2 Common Scenarios and how to fix them / Beginners Guide to Power BI
Solved: Need Help in Resolving Circular Dependency - Microsoft Fabric Community
Solved: Circular dependency - Microsoft Fabric Community

If I misunderstand your needs or you still have problems on it, please feel free to let us know.   

Best Regards, 
Menaka.
Community Support Team  



Hi @PranavR ,

I wanted to check if you had the opportunity to review the information provided by @johnbasha33 . Please feel free to contact us if you have any further questions. If the response has addressed your query, please accept it as a solution so other members can easily find it.

Thank you.

 

Hi @PranavR ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

johnbasha33
Super User
Super User

 

 

Recommended Fix: Use Power Query Instead of Calculated Columns

To avoid circular dependency and still get the desired Date, do this:

Option 1: Precalculate the Date in Power Query

  1. Go to Power Query (Transform Data)

  2. In the SalesAnalysis table:

    • Add a custom column like:

       

      powerquery
      = if [Type] = "Monthly" and [Month] <> null and [Day] <> null then
      #date([Year], [Month], [Day])
      else if [Type] = "Weekly" then
      null
      else
      null

      1. After that, merge with the Dim Calendar table on [YearWeek] (only for "Weekly" type rows)

      2. From that merged table, bring in the [Date] column

      3. Final step: create a single Date column that pulls either the monthly date or the merged weekly date

        This avoids using DAX for something that’s fundamentally a data transformation task.

        Option 2: Rebuild the Date Outside the Relationship Logic

        If you must use DAX:

        • Don't use CALCULATE(MAX(...)) that depends on the related table.

          Instead, consider bringing YearWeek-Date mapping as a lookup column into the SalesAnalysis table using Power Query or with a LOOKUPVALUE if small and not recursive:

          Weekly_Dt = LOOKUPVALUE('Dim Calendar'[Date], 'Dim Calendar'[YearWeek], 'SalesAnalysis'[YearWeek])

          LOOKUPVALUE is a scalar function and doesn't drag in the entire filter context, making it safe to use without triggering circular dependencies — in most cases.

          Did I answer your question? Mark my post as a solution! Appreciate your Kudos !@PranavR

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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