Forum Discussion

Joe_Grosskopf's avatar
Joe_Grosskopf
Helper II
3 years ago
Solved

Circular Dependancy with If statement

I can't understand where my dependancy is. I have 4 measures for running total...

 

RT_800-1Dir =
            VAR __date = max('Dept 800-1 Daily Time'[Date_Began])
            VAR __Table = FILTER(ALLSELECTED('Dept 800-1 Daily Time'),'Dept 800-1 Daily Time'[Date_Began] <= __date )
            return
            sumx(__Table,[Direct])
 
RT_800-1Indirect =
            VAR __date = max('Dept 800-1 Daily Time'[Date_Began])
            VAR __Table = FILTER(ALLSELECTED('Dept 800-1 Daily Time'),'Dept 800-1 Daily Time'[Date_Began] <= __date )
            return
            sumx(__Table,[Indirect Time])
 
RT_800-2Dir =
            VAR __date = max('Dept 800-2 Daily Time'[Date_Began])
            VAR __Table = FILTER(ALLSELECTED('Dept 800-2 Daily Time'),'Dept 800-2 Daily Time'[Date_Began] <= __date )
            return
            sumx(__Table,[Direct])
 
RT_800-2Indirect =
            VAR __date = max('Dept 800-2 Daily Time'[date_began])
            VAR __Table = FILTER(ALLSELECTED('Dept 800-2 Daily Time'),'Dept 800-2 Daily Time'[date_began] <= __date )
            return
            sumx(__Table,[Indirect Time])
 
I then have a table with two columns showing the RT
 
The RTDir column works fine
RT_Dir = if([Dept]="800-1",[RT_800-1Dir],if([Dept]="800-2",[RT_800-2Dir],0))
 
However the RTInd is giving me an error
RT_InDir = if([Dept]="800-1",[RT_800-1Indirect],if([Dept]="800-2",[RT_800-2Indirect],0))
 
<ccon>A circular dependency was detected: Combined Time 800[Column], Combined Time 800[RT_Dir], Combined Time 800[Column].</ccon>
 
I cannot figure out why one works and the other does not
 
Thank You
 

2 Replies