Forum Discussion

samk_49's avatar
samk_49
New Member
2 years ago
Solved

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: ...
  • Anonymous's avatar
    Anonymous
    2 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.