Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
4 years ago
Solved

How to get minimum dates from the row in a sharepoint list

How to get minimum dates from the row in a sharepoint list
 
I have 20 dates in single row, out of that I need to get the minimum (Early) date.
 
Example:

 

  • Hi, Syndicate_Admin ;

    You could add a conitional column as follow:

    The final show:

    M language:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtNA1NNQ1MlbSQXBMlWJ1iJQzRZOLBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date1 = _t, Date1.1 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date1", type date}, {"Date1.1", type date}}),
        #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Date1.1", "Date2"}}),
        #"Added Conditional Column" = Table.AddColumn(#"Renamed Columns", "Custom", each if [Date1] < [Date2] then [Date1] else if [Date2] <= [Date1] then [Date2] else null)
    in
        #"Added Conditional Column"


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi, Syndicate_Admin ;

    You could add a conitional column as follow:

    The final show:

    M language:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtNA1NNQ1MlbSQXBMlWJ1iJQzRZOLBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date1 = _t, Date1.1 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date1", type date}, {"Date1.1", type date}}),
        #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Date1.1", "Date2"}}),
        #"Added Conditional Column" = Table.AddColumn(#"Renamed Columns", "Custom", each if [Date1] < [Date2] then [Date1] else if [Date2] <= [Date1] then [Date2] else null)
    in
        #"Added Conditional Column"


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.