Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

TopN + Others - Circular reference

Hi all,

I've been struggling with a formula for a few days now so I'm reaching out for help.  I have read multiple articles and posts but still can't figure out what's causing the circular reference error in this statement.  I'm following an example I found online for creating Top N and "other" for customer tickets.  Below is my statement -

CSTs TopN+Others =
VAR RankCSTVolume = RANKX(ALL('CSTs from 2018 to current'),[Service Tickets Total],,DESC)
return
if (RankCSTVolume<=10, 'CSTs from 2018 to current'[Cat2andCat3], "Others")
 
The only calculated field is 'Service Tickets Total' -
Service Tickets Total =
CALCULATE(
    SUM('CSTs from 2018 to current'[Service Tickets]),
    ALLSELECTED('CSTs from 2018 to current'[Service Tickets])
)
Any ideas appreciated!  Thanks!

10 Replies

  • Try like

    CSTs TopN+Others =
    VAR RankCSTVolume = RANKX(ALLselected('CSTs from 2018 to current'),CALCULATE(
        SUM('CSTs from 2018 to current'[Service Tickets])
    ),,DESC)
    return
    if (RankCSTVolume<=10, 'CSTs from 2018 to current'[Cat2andCat3], "Others")
     
     
    
    CSTs TopN+Others =
    VAR RankCSTVolume = RANKX(ALL('CSTs from 2018 to current'),CALCULATE(
        SUM('CSTs from 2018 to current'[Service Tickets])
    ),,DESC)
    return
    if (RankCSTVolume<=10, 'CSTs from 2018 to current'[Cat2andCat3], "Others")
    
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

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