Forum Discussion
Live_Mace
2 years agoFrequent Visitor
Avoid Circular Dependency Error With Dependent Measures
I'm a novice with dax, so forgive me if this is a stupid question... My table looks like this: Period BI Prod Demand EI 202310 3200 3000 2200 4000 202311 4000 5000 3200 ...
vanessafvg
Community Champion
2 years agocan you please share your code?
one thing i would suggest is that if you can create the logic for these columns in power query, then do that there, but it all depends on how you are deriving this information.
- Live_Mace2 years agoFrequent Visitor
Proj_BI = CALCULATE( [Proj_EI], FILTER( ALL('Table'[Period]), 'Table'[Period] = MAX('Table'[Period]) - 1 ) ) Proj_EI = ([Proj_BI] + [Prod]) - [Demand] BIMeasure = IF(ISBLANK(SUM('Table'[BI])), [Proj_BI], SUM('Table'[BI])) EIMeasure = IF(ISBLANK(SUM('Table'[EI])), [Proj_EI], SUM('Table'[EI]))This is the code.
The calculation is only required at this level of aggregation, on the power query side the data is more granular.