Forum Discussion

robarivas's avatar
robarivas
Icon for Post Patron rankPost Patron
5 years ago

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

  • 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]))

    • robarivas's avatar
      robarivas
      Icon for Post Patron rankPost Patron

      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.

  • Anonymous's avatar
    Anonymous
    Not applicable

    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.