Forum Discussion

Vauban's avatar
Vauban
Icon for Helper I rankHelper I
6 years ago
Solved

Custom column M language filter formula translation from desktop new column formula

Hi to all. I have a formula that amitchandak graciously helped me on.  Unfortunately I realized I should have created it in the Query Editor instead of just making a new column in the tabs part of d...
  • dax's avatar
    dax
    6 years ago

    Hi Vauban , 

    You are using DAX instead of power query. If you want to achieve this in power query, you could refer to below code

     

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUTIEYVOlWB0E18gAzjUCCRmBuUkwxSg8UzgPpNQChWcG5xmDMTIPaGYsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [name = _t, id = _t, amount = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"name", type text}, {"id", Int64.Type}, {"amount", Int64.Type}}),
        #"Grouped Rows" = Table.Group(#"Changed Type", {"name", "id"}, {{"mivx", each List.Min([amount]), type number}, {"all", each _, type table [name=text, id=number, amount=number]}}),
        #"Expanded all" = Table.ExpandTableColumn(#"Grouped Rows", "all", {"amount"}, {"amount"})
    in
        #"Expanded all"

     

     

    If you want to use your expression, you need to create calculated column instead of power query, you need to create like below

     In addition, you also could use measure to achieve this, which will show in table visual, you could try below expression

     

     

    Measure 2 = CALCULATE(MIN(t[amount]), ALLEXCEPT(t,t[name],t[id]))

     

     

    Best Regards,
    Zoe Zhi

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