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
jefferson5
Regular Visitor

Sales Total by Product Category Circular Error

I am trying to create a table visual to display a number of summaries for product sales. The strange thing is the following works for four columns but when I add a fifth, I get a circular reference error.

 

I have three tables (simplified for demo): Sales, Products, Product Categories which have the associated relationships defined.

 

I want to display columns such as Sum for Ladies, Sum for Mens, Sum for Sundries, % Sundries of Total etc. Note, I do not want all categories so am not using a pivot visual. I am adding the following columns to the Sales table:

 

MensTotal = CALCULATE( SUM(SalesLines[price]), 'ProductCategory'[Name] = "MENS")
 
This appears to work ok until I create a fifth column, then I get a "A circular dependency was detected". It appears to be fine for the first four. It doesn't even matter if the fifth column is the same category as one of the other working ones, so does not appear to releate to the category itself.
 
Sorry, I am new to Power BI and am really struggling to understand why something which seems pretty simple is proving so difficult. Many thanks in advance.
2 REPLIES 2
HotChilli
Super User
Super User

Check this threadhttps://community.powerbi.com/t5/Desktop/quot-A-circular-Dependency-was-detected-quot-error-while/td...

That might be a bit advanced for your current powerbi knowledge but the reason for circular dependency is there.

 

Are you sure you want to create calculated columns in a table?  Don't you want to create measures and add them to a visualisation? And, slightly off-topic, does it make sense to SUM prices?

Many thanks for your response. I might have confused the terminology a bit - what I meant was I was adding columns and applying them to a visualisation as you suggest (not editing the query and adding columns).

 

I am summing sales lines (price) by staff member for a specific product category. I did not mention as wanted to keep example simple.

 

Deleting the columns and adding them as measures instead has resolved the issue but I am still confused. I was clicking "New Column" and entering DAX query which I think it was then treating as a measure because the field icon was showing as a calculation (not column icon). Explicitely choosing "New Measure" instead seems to have resolved it.

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.

Top Solution Authors