Forum Discussion
samk_49
2 years agoNew Member
How to overcome circular dependency while leveraging same measure?
I have a table that has Number of products in last 24 hrs column, Number of sold products and Number of products in inventory. I need to calculate Number of products. Following is my table: ...
- Anonymous2 years ago
Hi samk_49 ,
Please try to use this DAX to create a new column:Number of products = CALCULATE( SUM(Sheet12[Number of products in last 24 hrs]) - SUM(Sheet12[Number of sold products]) - SUM(Sheet12[Number of products in inventory]), FILTER( 'Sheet12', 'Sheet12'[Date] < EARLIER(Sheet12[Date]) ) ) + 'Sheet12'[Number of products in last 24 hrs] - 'Sheet12'[Number of products in inventory] - 'Sheet12'[Number of sold products]The final output is below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
2 years agoSuper User
samk_49 , Create a new measure using the current measure and try
Sumx(Values(Records[Date]), [PrevProd_Test])
samk_49
2 years agoNew Member
My apologies Amit, your code worked well for originally posted question. But, I had to change my question to provide better clarity.