Forum Discussion

RicPT's avatar
RicPT
Regular Visitor
2 years ago
Solved

Problem with filling empty spaces in column

I'm having a problem with PowerBI dax. I have a table with two columns, Index and Value, and i need a new column that is filled with the last non blank value of column Value, as shown next:   ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi RicPT ,

    Based on my testing again, please try the following DAX formula:

    1.Create the new column and enter the following DAX formula.

     

    filledcolumn = 
    var index_ = 'Table'[Index]
    RETURN
    CALCULATE(
        LASTNONBLANK('Table'[Value], TRUE()),
        FILTER(
            ALL('Table'),
            'Table'[index] <= index_
        )
    )

     

    2.Drag the column into the table visual. The result is shown below.

     

    Best Regards,

    Wisdom Wu

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