Forum Discussion

sentsara's avatar
sentsara
Helper II
8 years ago
Solved

DAX Expression for comparing rows

  Hi , I need help on "Rate Level Current" DAX Expression to built.   Requirement: Step:1 Take "current Forecast" Percentage value by applying filter on currrent "PM" Value  step:2 check under ...
  • TomMartens's avatar
    8 years ago

    Hey,

     

    I used this DAX statement to create a calculated column:

    calc Rate Level Current = 
    var currentPM = 'Table1'[PM]
    var currentForecast = 'Table1'[Current Forecast]
    var smallerScenarioRate =
    CALCULATE(
        MAX('Table1'[Scenario Rate])
        ,FILTER(
            ALL('Table1')
            ,'Table1'[PM] = currentPM && 'Table1'[Scenario Rate] < currentForecast
        )
    )
    return
    CALCULATE(
        MAX('Table1'[Rate Level])
        ,FILTER(
            ALL('Table1')
            ,'Table1'[PM] = currentPM && 'Table1'[Scenario Rate] = smallerScenarioRate
        )
    )

    This returns these values:

     

    And here is a small PBIX file

     

    Hopefully this is what you are looking for.

     

    Regards

    Tom