Forum Discussion

Quite_lost's avatar
Quite_lost
Frequent Visitor
5 years ago
Solved

Measure returning unexpected value

Hi, I quite new to PowerBI and DAX structure and need some help. I am trying to make an Inventory History dashboard that has a measure Average Sales by month in the context of shortage of stock of t...
  • V-lianl-msft's avatar
    V-lianl-msft
    5 years ago

    Hi Quite_lost ,

     

    Based on your description, I checked your example pbix and found the problem.

    The reason is that you turn off the interaction between Movement Type slicer and Days "in stock".

    Correspondingly, you need to clear the filter of Movement Type in the calculation.

    Average Sales by Month "in stock" = var t = [Total Quantity]
    var m = CALCULATE([Months "in stock"],ALL('Stock History'[Movement Type]))
    return DIVIDE(t,m)

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.