Forum Discussion

WaelTalaat79's avatar
WaelTalaat79
Icon for Helper I rankHelper I
2 years ago
Solved

Calculate value in coulamn based on Max week Number

Dears thanks for your support in advance i have this DAX fromula to calculate the stock value in coulmn based on another coulmn slicer range week number Ex. the slicer from Week 10 to week 17 i n...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi WaelTalaat79 

     

    Thanks for the reply from Ritaf1983 .

     

    WaelTalaat79 , you can try the following method as follows.

     

    My sample:

     

    1. Create a calculated table as the slicer

    Slicer = VALUES('Table'[weeknum])

     

     

    2. Create a measure as follows

    Measure = 
    VAR _max = CALCULATE(SUM('Table'[Value]), FILTER('Table', [weeknum] = MAX('Slicer'[weeknum])))
    VAR _min = CALCULATE(SUM('Table'[Value]), FILTER('Table', [weeknum] = MIN('Slicer'[weeknum])))
    RETURN
    _max - _min

     

    Output:

     

    Best Regards,
    Yulia Xu

     

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