none
Unexpected error: Operation is not valid due to the current state of the object. RRS feed

  • Question

  • fnWeek_Name can be successfully invoked if either "Week 1" or "Week 2" or "Week 3" is entered as an argument.

    fnWeek_Name produces an Operation is not valid error when used here:

    let
        Source = AllWeeks,
        #"Removed Other Columns1" = Table.SelectColumns(Source,{"Name"}),
        #"Filtered Rows" = Table.SelectRows(#"Removed Other Columns1", each ([Name] <> "Desired Result")),
        #"Added Custom" = Table.AddColumn(#"Filtered Rows", "Custom", each fnWeek_Name([Name]))
    in
        #"Added Custom"

    Below are the following in this order:

    1. Details of Error

    2. M Code listing for fnWeek_Name

    3. M Code listing for Source

    4. Note: If you provide a way, I can send you a copy of the xlsx - data file.

    Details of Error:

    Error Message:

    Operation is not valid due to the current state of the object.

    Stack Trace:

    Microsoft.Mashup.Evaluator.Interface.ErrorException: Operation is not valid due to the current state of the object. ---> System.InvalidOperationException: Operation is not valid due to the current state of the object. ---> System.InvalidOperationException: Operation is not valid due to the current state of the object.
       at Microsoft.Mashup.Engine1.Language.Compiler.ToFunction(IFunctionExpression expression)
       at Microsoft.Mashup.Engine1.Runtime.CollapseNestedFunctionsVisitor.VisitFunction(IFunctionExpression node)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitExpression(IExpression expression)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitInvocation(IInvocationExpression invocation)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitExpression(IExpression expression)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitListElements(IExpression[] list)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitInvocation(IInvocationExpression invocation)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitExpression(IExpression expression)
       at Microsoft.Mashup.Engine.Ast.LogicalAstVisitor2`1.VisitInitializer(VariableInitializer member)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitListElements(VariableInitializer[] list)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitListElements(IList`1 list)
       at Microsoft.Mashup.Engine.Ast.LogicalAstVisitor2`1.VisitRecord(IRecordExpression record, TBinding binding, IList`1 bindings)
       at Microsoft.Mashup.Engine1.Runtime.CollapseNestedFunctionsVisitor.VisitRecord(IRecordExpression node)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitExpression(IExpression expression)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitFieldAccess(IFieldAccessExpression fieldAccess)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitExpression(IExpression expression)
       at Microsoft.Mashup.Engine.Ast.LogicalAstVisitor2`1.VisitFunction(IFunctionExpression function, IList`1 bindings)
       at Microsoft.Mashup.Engine1.Runtime.CollapseNestedFunctionsVisitor.VisitFunction(IFunctionExpression node)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitExpression(IExpression expression)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitInvocation(IInvocationExpression invocation)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitExpression(IExpression expression)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitListElements(IExpression[] list)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitList(IListExpression list)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitExpression(IExpression expression)
       at Microsoft.Mashup.Engine.Ast.LogicalAstVisitor2`1.VisitFunction(IFunctionExpression function, IList`1 bindings)
       at Microsoft.Mashup.Engine1.Runtime.CollapseNestedFunctionsVisitor.VisitFunction(IFunctionExpression node)
       at Microsoft.Mashup.Engine.Ast.AstVisitor2.VisitExpression(IExpression expression)
       at Microsoft.Mashup.Engine1.Language.Query.NormalizationVisitor.Normalize(IExpression node, Boolean normalizeInvocation)
       at Microsoft.Mashup.Engine1.Language.Query.AddColumnsQuery.CreateQueryExpressions(FunctionValue columnGeneratorFunction, Keys columns)
       at Microsoft.Mashup.Engine1.Language.Query.AddColumnsQuery.get_QueryExpressions()
       at Microsoft.Mashup.Engine1.Language.Query.AddColumnsQuery.SelectColumns(ColumnSelection columnSelection)
       at Microsoft.Mashup.Engine1.Language.Query.Query.ProjectColumns(ColumnSelection columnSelection)
       at Microsoft.Mashup.Engine1.Runtime.TableValue.SelectColumns(ColumnSelection columnSelection)
       at Microsoft.Mashup.Engine1.Runtime.TableValue.RemoveColumns(Value columns, MissingFieldMode missingField)
       at Microsoft.Mashup.Engine1.Library.Table.TableModule.Table.RemoveColumnsFunctionValue.TypedInvoke(TableValue table, Value columns, Value missingField)
       at Microsoft.Mashup.Engine1.Runtime.NativeFunctionValue3`4.Invoke(Value arg0, Value arg1, Value arg2)
       at Microsoft.Mashup.Engine1.Language.DebugExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.RecordExpression.RuntimeRecordValue.Force(Int32 index)
       at Microsoft.Mashup.Engine1.Language.RecordExpression.RuntimeRecordValue.get_Item(Int32 index)
       at Microsoft.Mashup.Engine1.Language.FunctionInvocationExpression1.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.DebugExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.FunctionInvocationExpression1.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.DebugExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.RecordExpression.RuntimeRecordValue.Force(Int32 index)
       at Microsoft.Mashup.Engine1.Language.RecordExpression.RuntimeRecordValue.get_Item(Int32 index)
       at Microsoft.Mashup.Engine1.Language.FieldAccessExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.DebugExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.EqualsExpression.ExecuteCondition(Value frame)
       at Microsoft.Mashup.Engine1.Language.ConditionExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.DebugExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.AndExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.DebugExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.AndExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.DebugExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.RecordExpression.RuntimeRecordValue.Force(Int32 index)
       at Microsoft.Mashup.Engine1.Language.RecordExpression.RuntimeRecordValue.get_Item(Int32 index)
       at Microsoft.Mashup.Engine1.Language.Expression.ExecuteCondition(Value frame)
       at Microsoft.Mashup.Engine1.Language.IfExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.DebugExpression.Execute(Value frame)
       at Microsoft.Mashup.Engine1.Language.RecordExpression.RuntimeRecordValue.Force(Int32 index)
       at Microsoft.Mashup.Engine1.Language.RecordExpression.RuntimeRecordValue.get_Item(Int32 index)
       at Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
       at Microsoft.Mashup.Engine1.Language.RecordExpression.RuntimeRecordValue.Force(Int32 index)
       at Microsoft.Mashup.Engine1.Language.RecordExpression.RuntimeRecordValue.get_Item(Int32 index)
       at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass7.<WriteMetaField>b__6()
       at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
       at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WriteMetaRecord(IRecordValue value, Boolean truncatedValue)
       at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WriteValueEnd(IValue value, IRecordValue meta, Boolean truncated)
       at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WritePreviewValue(IValue value, Int32 serializeStructuredValueDepth)
       at Microsoft.Mashup.Evaluator.Services.ValueSerializer.SerializePreviewValue(IEngine engine, IValue value, Action`2 rowCountCallback)
       at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.SerializeRows(Int32 count)
       at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.get_SmallValue()
       at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
       at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.<>c__DisplayClass5.<RunStub>b__3()
       at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
       --- End of inner exception stack trace ---
       at Microsoft.Mashup.Evaluator.EvaluationHost.<>c__DisplayClass7.<TryReportException>b__6()
       at Microsoft.Mashup.Common.SafeExceptions.IgnoreSafeExceptions(IHostTrace trace, Action action)
       at Microsoft.Mashup.Evaluator.EvaluationHost.TryReportException(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Exception exception)
       at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
       at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.RunStub(IEngineHost engineHost, IMessageChannel channel, Func`1 getPreviewValueSource)
       at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass1f`1.<OnBeginGetResult>b__1c()
       at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
       at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 action)
       at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
       at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
       at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
       at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
       at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
       at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
       at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
       at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
       at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
       at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass15.<CreateAction>b__14(Object o)
       at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
       at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
       --- End of inner exception stack trace ---
       at Microsoft.Mashup.Evaluator.EvaluationHost.OnException(IEngineHost engineHost, IMessageChannel channel, ExceptionMessage message)
       at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
       at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
       at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
       at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
       at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
       at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.WaitFor(Func`1 condition, Boolean disposing)
       at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.get_SmallValue()
       at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
       at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled)

    Invocation Stack Trace:

       at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
       at Microsoft.Mashup.Client.ClientShared.FeedbackErrorInfo..ctor(String message, Nullable`1 errorCode, String requestId, Exception exception)
       at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0()
       at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.HandleException(Exception e)
       at Microsoft.Mashup.Client.ClientShared.Ux.HtmlForm.<>c__DisplayClass6.<OnAjaxException>b__5()
       at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ThreadContext.LocalModalMessageLoop(Form form)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
       at Microsoft.Mashup.Client.ClientShared.WindowManager.ShowDialog[T](T form, IWin32Window owner)
       at Microsoft.Mashup.Client.Excel.QueriesEditorWindowManager.ShowModalQueriesEditorWindow(IWin32Window ownerWindow, IWorkbookIdentity workbookIdentity, QueriesEditorParameters queriesEditorParameters, Queries queries)
       at Microsoft.Mashup.Client.Excel.DialogManager.TryShowModalEditor(IWin32Window ownerWindow, IWorkbook workbook, Query query, Boolean isNewQuery, Boolean navigatorExpanded)
       at Microsoft.Mashup.Client.Excel.ExcelQueryServices.<>c__DisplayClass14.<EditQuery>b__13(IWorkbook workbook)
       at Microsoft.Mashup.Client.Excel.ExcelQueryServices.TryInvokeOnWorkbook(Action`1 action)
       at Microsoft.Mashup.Client.ClientShared.ContextMenuRenderer.<>c__DisplayClass7.<CreateMenuItem>b__3()
       at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
       at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
       at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
       at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
       at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
       at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
       at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ToolStrip.WndProc(Message& m)
       at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    fnWeek_Name 

    (Name as text) =>
    let
        Source = AllWeeks,
        #"Week Sheet" = Source{[Item=Name,Kind="Sheet"]}[Data],
        #"Removed Other Columns" = Table.SelectColumns(#"Week Sheet",{"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12"}),
        #"Changed Type" = Table.TransformColumnTypes(#"Removed Other Columns",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type any}, {"Column5", type any}, {"Column6", type any}, {"Column7", type any}, {"Column8", type any}, {"Column9", type any}, {"Column10", type any}, {"Column11", type any}, {"Column12", type date}}),

        //Note (1)
        //  Save earliest date of the week, for use with Note(2) and Note (4).  
        #"Get FirstDateofWeek" = #"Changed Type"[Column6]{1},
        #"Filled Down" = Table.FillDown(#"Changed Type",{"Column1", "Column2", "Column4", "Column5"}),
        #"Removed Top Rows" = Table.Skip(#"Filled Down",1),
        #"Transposed Table" = Table.Transpose(#"Removed Top Rows"),
        #"Duplicated Column" = Table.DuplicateColumn(#"Transposed Table", "Column1", "Column1 - Copy"),
        #"Changed Type1" = Table.TransformColumnTypes(#"Duplicated Column",{{"Column1 - Copy", type date}}),
        #"Replaced Errors" = Table.ReplaceErrorValues(#"Changed Type1", {{"Column1 - Copy", null}}),

        //Note (2)
        //We need to keep track of dates, but can't use date as a column name because it changes each week..
        //  As a solution I convert the date to # of days difference (between 0 and 7),
        //  then once done transposing, add days-difference and FirstDayofWeek = return actual dates
        //  
        #"Calculated Days Dif" = Table.TransformColumns(#"Replaced Errors",{{"Column1 - Copy", each _ - #"Get FirstDateofWeek", type duration}}),
        #"Changed Type3" = Table.TransformColumnTypes(#"Calculated Days Dif",{{"Column1 - Copy", Int64.Type}}),
        #"Added Conditional Column" = Table.AddColumn(#"Changed Type3", "Custom", each if [#"Column1 - Copy"] = null then [Column1] else [#"Column1 - Copy"] ),
        #"Removed Columns1" = Table.RemoveColumns(#"Added Conditional Column",{"Column1", "Column1 - Copy"}),
        #"Renamed Columns" = Table.RenameColumns(#"Removed Columns1",{{"Custom", "Column1"}}),
        #"Changed Type2" = Table.TransformColumnTypes(#"Renamed Columns",{{"Column1", type text}}),

        //Note (3)
        //Column1 must contain Column labels here so after transposition labels are in the first row, so columns must be reordered.
        //  The standard UI method for reordering all columns will not work because the list of columns can change each week.
        //  Since we never know ahead of time how many columns, we need to build the list of columns here.
        //  The next 5 expressions are used to create a list of current columns in the correct order.
        #"Get ColNames" = Table.ColumnNames(#"Changed Type2"),
        #"Converted to Table" = Table.FromList(#"Get ColNames", Splitter.SplitByNothing(), null, null, ExtraValues.Error),
        #"Sorted Rows" = Table.Sort(#"Converted to Table",{{"Column1", Order.Ascending}}),
        #"Col List" = Table.ToList(#"Sorted Rows"),
        #"Reorder Columns" = Table.ReorderColumns(#"Changed Type2",#"Col List"),

        #"Transposed Table1" = Table.Transpose(#"Reorder Columns"),
        #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table1"),
        #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Promoted Headers", {"ORIGIN", "Carrier", "Name", "ETA", "Lock Out"}, "Attribute", "Value"),
        #"Changed Type4" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Attribute", Int64.Type}}),

        //Note (4)
        //Here is where Work Date is reconstructed.  Column "Attribute" stores Note (2)'s Calculated-Days-Dif.
        //  Add to each Calculated-Day-Dif Note(1)'s FirstDateofWeek 
        #"Change Attribute to Dates" = Table.TransformColumns(#"Changed Type4",{{"Attribute", each Date.AddDays(#"Get FirstDateofWeek", _)}}),
        #"Changed Type5" = Table.TransformColumnTypes(#"Change Attribute to Dates",{{"Value", type time}}),
        #"Renamed Columns1" = Table.RenameColumns(#"Changed Type5",{{"Value", "Actual Arrival Time"}, {"Attribute", "Work Date"}}),
        #"Changed Type6" = Table.TransformColumnTypes(#"Renamed Columns1",{{"ETA", type time}, {"Lock Out", type time}, {"ORIGIN", type text}, {"Carrier", type text}, {"Name", type text}, {"Work Date", type date}}),
        #"Removed Errors" = Table.RemoveRowsWithErrors(#"Changed Type6", {"Actual Arrival Time"}),
        #"Filtered Rows" = Table.SelectRows(#"Removed Errors", each ([Actual Arrival Time] <> null)),
        #"Added Custom" = Table.AddColumn(#"Filtered Rows", "FirstDateofWeek", each #"Get FirstDateofWeek"),
        #"Changed Type7" = Table.TransformColumnTypes(#"Added Custom",{{"FirstDateofWeek", type date}})
    in
        #"Changed Type7"

    Source M code:

    let
        Source = Excel.Workbook(File.Contents("C:\Users\Dan\LocalSoftware\MS Power Query, M, Dax, SQLSvr, Access\M PowerQuery\excelguru\Hub Truck Dashboard 2017 - Copy.xlsx"), null, true)
    in
        Source



    Tuesday, June 20, 2017 12:18 PM

Answers