Forum Discussion

efeiles's avatar
efeiles
Frequent Visitor
7 years ago
Solved

Dynamic Column calculation based on Slicer Selection

I work at a manufacturing company and we are trying to understand quantities of parts used over time.  I have a matrix table with part number as the dimension.  I have a beginning value (qty on hand at the beginning of the year.  I sum the stuff we have received over time and how much we have used over time.  My final is what we are reporting as current on hand qty.  My table for this has the part number, date, and qty.  

 

I am trying to only have the max on hand qty show in the table based on the part number selected and the time period selected.  Currently it just wants to sum up all on hand qty over time.

 

How do I just get the max "current on hand qty" based on part selection and/or Date selection?

 

I only want the 5,908.27 to show on the CurrentOnHandQty

  • Well I actually finally searched enough and found the answer that worked for me.

     

    = CALCULATE(MAX(EndingQty[CurrOnHandQty]),DATESBETWEEN(DateTable[PeriodBegDt].[Date],MAX(DateTable[PeriodBegDt]),MAX(DateTable[PeriodBegDt])))

1 Reply

  • efeiles's avatar
    efeiles
    Frequent Visitor

    Well I actually finally searched enough and found the answer that worked for me.

     

    = CALCULATE(MAX(EndingQty[CurrOnHandQty]),DATESBETWEEN(DateTable[PeriodBegDt].[Date],MAX(DateTable[PeriodBegDt]),MAX(DateTable[PeriodBegDt])))