Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Jaed
Frequent Visitor

DAX: Avoid cyclic dependency

Hi all,

 

 I am new to power BI.

 

I am trying to calculate the daily open pieces.

 

I am able to do this in excel, but when copieng to PBI I get a cyclic dependency.

 

Jaed_0-1692000636884.png

 

Pieces requested = sum of all open pieces on a certain requested dispatch date

Pieces Shipped = sum of all pieces shipped on a certain loaded dispatch date

Backlog Formula = first row  // =B3-D3 and from there on =C4-D4

Pieces requested +Backlog = first row  // =B3 and from there on =B4+E3

 

I have tried working with offset, but only get a cyclic dependency.

 

Is there a solution doing it in this logic?

 

Much appreciate your help.

 

BR

 

 

2 ACCEPTED SOLUTIONS
MFelix
Super User
Super User

Hi @Jaed ,

 

For this you need to create two different measures:

Pieces Requested  + Backlog =
VAR temptable =
    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] < MAX ( 'Table'[Date] ) )
RETURN
    SUM ( 'Table'[Pieces Requested] )
        + SUMX ( temptable, 'Table'[Pieces Requested] - 'Table'[Pieces Shiped] )




Backlog =
VAR temptable =
    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] <= MAX ( 'Table'[Date] ) )
RETURN
    SUMX ( temptable, 'Table'[Pieces Requested] - 'Table'[Pieces Shiped] )

MFelix_0-1692032222189.png

 

If you want to have this based on a column redo the formulas to:

Backlog Column = 
VAR temptable =
    FILTER (  'Table', 'Table'[Date] <= EARLIER(  'Table'[Date] ) )
RETURN
    SUMX ( temptable, 'Table'[Pieces Requested] - 'Table'[Pieces Shiped] )

Pieces Requested  + Backlog Column = 
VAR temptable =
    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] < EARLIER(  'Table'[Date] ) )
RETURN
     'Table'[Pieces Requested] 
        + SUMX ( temptable, 'Table'[Pieces Requested] - 'Table'[Pieces Shiped] )

 

MFelix_1-1692032401030.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





View solution in original post

Jaed
Frequent Visitor

Thank you very much 🙂

View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @Jaed ,

 

For this you need to create two different measures:

Pieces Requested  + Backlog =
VAR temptable =
    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] < MAX ( 'Table'[Date] ) )
RETURN
    SUM ( 'Table'[Pieces Requested] )
        + SUMX ( temptable, 'Table'[Pieces Requested] - 'Table'[Pieces Shiped] )




Backlog =
VAR temptable =
    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] <= MAX ( 'Table'[Date] ) )
RETURN
    SUMX ( temptable, 'Table'[Pieces Requested] - 'Table'[Pieces Shiped] )

MFelix_0-1692032222189.png

 

If you want to have this based on a column redo the formulas to:

Backlog Column = 
VAR temptable =
    FILTER (  'Table', 'Table'[Date] <= EARLIER(  'Table'[Date] ) )
RETURN
    SUMX ( temptable, 'Table'[Pieces Requested] - 'Table'[Pieces Shiped] )

Pieces Requested  + Backlog Column = 
VAR temptable =
    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] < EARLIER(  'Table'[Date] ) )
RETURN
     'Table'[Pieces Requested] 
        + SUMX ( temptable, 'Table'[Pieces Requested] - 'Table'[Pieces Shiped] )

 

MFelix_1-1692032401030.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Jaed
Frequent Visitor

Thank you very much 🙂

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.