Forum Discussion
Custom column M language filter formula translation from desktop new column formula
- 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 ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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.