Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Don't sum an Inventory value

Hi,

 

I have a situation with a matrix, where I am comparing plan vs Actual Inventory by month for 4 categaries.

 

But when I select a whole year, the inventory values of all months get summed up for Plan and Actual column. This would be wrong for checking Inventory, as it indicates stock at a point of time (i.e, the values should not sum up when I choose a year, but show the latest month's figures). Is there a way to show this with a "Year, Month" filter on?? PFA the screenshot.

 

 

 

 

11 Replies

  • HoangHugo's avatar
    HoangHugo
    Solution Specialist

    Hi

    try Function TOTALMTD( ), or CALCULATE(your measure, DATESMTD) to calculate Inventory of latest month, in filter context.

  • Hi,

    Share the download link of your PBI file and show the expected result very clearly.

  • Mikelytics's avatar
    Mikelytics
    Resident Rockstar

    Hi Anonymous m

     

    Did you try writing a measure like this?

     

     

    Last Date Value =
    
    CALCUALTE(
       SUM(Table[Value Column]),
       LASTDATE(table[Date Column]
    )

     

     

    The date column needs to have a date format. The measure checks the dates in scope (based on your filter) and selects the last avaiable. Then it takes only the sum for the values for this last date. I use it in nearly every scenario where I work with balance values. There might be some changes required based on your requirements and data model but in general that should to it when I udnerstand your request correctly.

     

    Best regards

    Michael

    -----------------------------------------------------

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!

    @ me in replies or I'll lose your thread.