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
robarivas
Post Patron
Post Patron

RANKX Calc Column Circular Dependency

Tried the SQLBI articles but still can't get past this issue. I have no other calculated columns and no relationships to any other tables. I'm trying to create a calculated column of (conditional) ranks. Here is my data structure and what I'm trying to acheive (Type_X_Dollars_Rank). Every version of the RANKX formula I try keeps giving me a circular dependency error.

 

Because my dollars column is intentionally non-additive, the measure I used to generate the proper sum of the dollars (by Product_Index) is as follows: SUMX(DISTINCT(Table.ProductIndex),FIRSTNONBLANK(Table.Dollars,0))

 

Product Sub_Product Department Dollars Product_Index Table_Index (PK) Product_Type Type_X_Dollars_Rank  
A12Home$10011X

($100 + $200 = $300)

A21Home$10012X

($100 + $200 = $300)

A33Work$20023X

($100 + $200 = $300)

B45Home$30034Y

 

B54School$15045Y

 

C62Work$25056X

2

($250)

C20Work$25067X

2

($250)

D71Home$32578Y

 

D74Home$32579Y

 

3 REPLIES 3
v-xiaoyan-msft
Community Support
Community Support

Hi @robarivas ,

 

Here is a similar case, please check if it is helpful to you.

Circular dependency in Power Bi 

If I have not understood your needs correctly, please do not hesitate to inform me.

 

Hope it helps,


Community Support Team _ Caitlyn Yan


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

amitchandak
Super User
Super User

@robarivas , I doubt that is sum Product_Index , if so sum for c will be 500

 

Try one of the two measures

 

Measure = Sumx(summzarize(filter(Table, Table[Product_Type] ="X"), [Product], [Dollars], ),[Dollars])

 

 

or


Measure = calculate(Sumx(summzarize(filter(Table, Table[Product_Type] ="X"), [Product], [Dollars], ),[Dollars]), allexpect(Table, Table[Product]))

Thanks @amitchandak but I think your response has to do with summing the dollars. My question/problem, however, is about the rankx function and the circular dependecy  error it keeps giving me.

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.