Forum Discussion

TGS84's avatar
TGS84
Regular Visitor
7 years ago
Solved

Dax Measure Fill Down Value

I have two measures which calculate a value for a year. See following table. My goal is to fill the gaps for measure B with the last available value. The result should look like:   Which ...
  • v-chuncz-msft's avatar
    7 years ago

    TGS84,

     

    You may add an additional measure.

    Measure =
    VAR y =
        SELECTEDVALUE ( Table1[Year] )
    RETURN
        CALCULATE (
            [Measure B],
            TOPN (
                1,
                FILTER (
                    ALLSELECTED ( Table1[Year] ),
                    Table1[Year] <= y
                        && NOT ( ISBLANK ( [Measure B] ) )
                ),
                Table1[Year], DESC
            )
        )