Forum Discussion
CarlsBerg999
3 years agoHelper V
Circular dependency
Hi,
I have a situation with a pretty obvious circularity. My data contains 3 productions where the output is always used in the next production. We first make production number 1. and then uti...
MarkLaf
3 years agoSuper User
Can you please provide sample tables and a description or pseudocode of what measure or other output you are looking for?
Shot in the dark, but I suspect you could take an approach similar to parent-child hierarchy to get what you want.
Another approach I've used before is to use a separate table to define relationship between rows in your table, set up inactive relationships, and then build measures using 'Original Table' --Activated Physical Relationship--> 'Relationship Table' --Virtual Relationship--> 'Original Table'
Another option (probably the better option if possible) would be to remodel your data. Something like
Production Step Dimension
| Id (PK) | Output Cost |
| 1 | $500 |
| 2 | $400 |
| 3 | $450 |
| 4 | $600 |
Production Process Dimension
| Id (PK) | Name |
| 1 | Process A |
| 2 | Process B |
Full Production Fact
| Production Process Id (FK) | Sequence | Production Step (FK) | Volume |
| 1 | 1 | 2 | 4 |
| 1 | 2 | 3 | 5 |
| 1 | 3 | 1 | 5 |
| 2 | 1 | 1 | 3 |
| 2 | 2 | 4 | 6 |
Then, you could do a measure like
Total Cost =
SUMX(
'Full Production Fact',
RELATED( 'Production Step Dimension'[Output Cost] )
* 'Full Production Fact'[Volume]
)