Forum Discussion

dccosta's avatar
dccosta
Frequent Visitor
2 years ago
Solved

Obtaining a column value based on two other columns' values

So essentially I have a table 1 with budget data:   Flight date | Year | Budget Version | ammount 01/01 | 2023 | V1 | 1312 02/01 | 2023 | V1 | 1245 07/02 | 2023 | V2 | 2525 10/08 | 2023 | V3 | ...
  • FreemanZ's avatar
    2 years ago

    hi dccosta ,

     

    try like:

    Measure =
    VAR _year = SELECTEDVALUE(table1[Year])
    VAR _result =
    MAXX(
        TOPN(
             1,
            FILTER(table2, table2[Year]=_year),
            table2[Order]
        ),
        table2[Budget Version]
    )
    RETURN _result