Forum Discussion

GeoffHill's avatar
GeoffHill
Frequent Visitor
5 years ago
Solved

DAX to M language

Hi, I'm trying to convert the below calculated column in DAX to Power Query M language so the Calculated column can refresh with the scheduled refresh. DAX for Calculated column is: WS Name = CALC...
  • v-yingjl's avatar
    5 years ago

    Hi GeoffHill ,

    Since the equiment dax formula in this case is min(), you can try this query:

    MIN ( <column> ) = FIRSTNONBLANK ( <column>, 1 )

    let
        Source = Table.NestedJoin(#"(Discount) Outlet Contract WS Number", {"Outlet__c"}, #"(Discount) Supplier Outlet", {"Outlet__c"}, "(Discount) Supplier Outlet", JoinKind.LeftOuter),
        #"Added Custom" = Table.AddColumn(Source, "Result", each List.Min([#"(Discount) Supplier Outlet"][Primary Wholesaler Name]),type text),
        #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"(Discount) Supplier Outlet"})
    in
        #"Removed Columns"

     

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