Forum Discussion

ErickReris's avatar
ErickReris
Frequent Visitor
1 year ago
Solved

Replace Date Values in a single column

I have 4 columns of data in Power BI. A column called Initial Forecast, which informs the initial delivery forecast for the order. A column called Forecast Delivery, which reports the forecast data...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi,

    Thanks for the solution michaelu1  offered, and i want to offer some more information for user to refer to.

    hello  ErickReris  , you can refer to the following sample.Sample data 

    Create a calculated column.

    Column =
    VAR a = [Initial Forecast] & "|" & [Forecast Delivery] & "|" & [Delivery Date] & "|" & [Entry Date]
    VAR b =
        ADDCOLUMNS (
            GENERATESERIES ( 1, PATHLENGTH ( a ) ),
            "Item", PATHITEM ( a, [Value] )
        )
    VAR c =
        MINX ( FILTER ( b, [Item] <> BLANK () ), [Value] )
    RETURN
        DATEVALUE ( MINX ( FILTER ( b, [Value] = c ), [Item] ) )

    Output

    Best Regards!

    Yolo Zhu

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