Forum Discussion

CesiCash's avatar
CesiCash
Regular Visitor
8 years ago

Compare inventory yesterday vs. eom

Hi There,

 

I'm completly new to powerbi - and hope you can help me out.

 

I have a table with our inventory split down by product. What i want to do is compare yesterdays stock with the stock of the end of last month, for example in a kpi vizualitation. But i am completly lost.

 

This is how my table looks like - i cant do vlookup as one product is a duplicate (lets call it "emium") . This is because in the backend it is two product (but with the same name) for our board it is just one)

 

 

 

 

 

 

I also have this datetable

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Do you have any idea how i can do this?

Best

Cesi

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    CesiCash to calculate last day for previous month use

     

    calculate(sum(inventory), LASTDATE ( PREVIOUSMONTH ([Date])))
    calculate(sum(inventory),  PREVIOUSDAY ([Date]))

     

    you can compare them with if and then output the result

    • CesiCash's avatar
      CesiCash
      Regular Visitor

      Hi Anonymous

       

      Thank you for response. 

      Unfortunately it doesnt work.

       

      I was able to calculate a column for Yesteraday inventory:

      Inventory Yesterday = CALCULATE(SUM('Product'[Trial]),'Previous Date')

       

      But i could not make the second column for Last Month value:

      Inventory EOM = CALCULATE(SUM('Product'[Trial]),LASTDATE(PREVIOUSMONTH(Datetable[Date].[Date])))

       

       

      It always tells me "A circular dependency was detected: Product[Inventory EOM], Product[Inventory Yesterday], Product[Inventory EOM]."

       

       

      What did I do wrong?

      Best

      Carina

      • Anonymous's avatar
        Anonymous
        Not applicable

        CesiCash you are creating them as columns I am guessing, you need to create measures.