Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Dynamically find next min value compared to previous value stored in a measure

First of all, pardon me if the subject title is a little misleading but I found it hard to describe the problem effectively as a title. First off, some background information: I have a table with...
  • d_gosbell's avatar
    7 years ago

    You can do this, the issue is that inside your Filter() call the value for the [min val 1] measure is recalculated for each row. This effectively filters out every row as the min value for a single row is the value of the index for that row.

     

    The simple fix is to use a variable to capture the value of the measure outside of the filter.

     

    min val 2 = 
    var _min_val_1 = [min val 1]
    return calculate(min('Table1'[Index]),FILTER('Table1','Table1'[Index]> _min_val_1))