Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
andreben
New Member

Impossible to open any pbix file: Invalid character

Hello!

 

I suddenly cannot open, nor save, any pbix file as I get the following error: Invalid character in the given encoding. Line 1 Position 1.

I already tried to uninstall and reinstall PBI Desktop from Microsoft Store but it didn't help.

If I open a blank canvas, and then I tried to save it, I get the same error and the file doesn't get saved.

Any further idea?

 

Thanks!

download.png

 

3 REPLIES 3
Captain415
New Member

I have a similar issue.  I am unable to edit two of five queries in my workbook due to an "Invalid Character" error message.  I also noticed that the two queries have been renamed by Excel with a suffix of "(2)".  Why would the query names change?

 

I'm using the following Windows build.

Edition: Windows 10 Enterprise

Version: 21H2

OS Build: 19044.2965

Experience: Windows Feature Experience Pack 1000.19041.1000.0

 

Following is the dump provided by Excel after the "Something went wrong" message.  I've bold highlighted the two queries in error, at the bottom.  I Cannot provide all five queries, nor the entire dump due to character limitations on a reply.

  

Feedback Type:
Frown (Error)

Error Message:
Invalid character

Stack Trace:
at EditorNavigatorViewHost.prototype.onTreeNodeClicked (ms-pq://pq.microsoft.com/ts/Editor/EditorNavigatorViewHost.js:36:13)
at Anonymous function (ms-pq://pq.microsoft.com/ts/Shared/ResultViews/NavigatorViewControl.js:285:17)
at n.event.dispatch (ms-pq://pq.microsoft.com/opensource/jquery/jquery-2.2.4.js:3:7481)
at r.handle (ms-pq://pq.microsoft.com/opensource/jquery/jquery-2.2.4.js:3:5547)

Stack Trace Message:
Invalid character

Invocation Stack Trace:
at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
at Microsoft.Mashup.Client.UI.Shared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace, String exceptionMessage)
at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo..ctor(String message, Exception exception, Nullable`1 stackTraceInfo, String messageDetail)
at Microsoft.Mashup.Client.UI.Shared.IUIHostExtensions.RaiseErrorDialog(IUIHost uiHost, IWindowHandle activeWindow, FeedbackPackageInfo feedbackPackageInfo, Exception e, LocalizedString dialogTitle, LocalizedString dialogMessage, Boolean useGDICapture)
at Microsoft.Mashup.Client.Excel.Native.NativeUserFeedbackServices.ReportException(IWindowHandle activeWindow, IUIHost uiHost, FeedbackPackageInfo feedbackPackageInfo, Exception e, Boolean useGDICapture)
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.<>c__DisplayClass14_0.<HandleException>b__0()
at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.SendAndMarshalExceptions(SynchronizationContext context, Action callback)
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.HandleException(Exception e)
at Microsoft.Mashup.Client.UI.Shared.WebDialogs.WebDialogBase`1.DelayedInitializationExceptionHandler.HandleException(Exception e)
at Microsoft.Mashup.Client.UI.Windows.JsErrorHandler.HandleJavaScriptError(String message, String stackTrace)
at Microsoft.Mashup.Client.UI.Shared.WebDialogs.WebDialog.OnError(String message, String stackTrace)
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.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Mashup.Client.UI.Shared.JsExportWrapper.ExportedMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Mashup.Client.UI.Shared.JsExportWrapper.<>c__DisplayClass13_0.<InvokeMember>b__0()
at Microsoft.Mashup.Client.UI.Windows.JsErrorHandler.WrapInvokeHost(Func`1 invokeHost)
at Microsoft.Mashup.Client.UI.Shared.JsExportWrapper.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
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.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at Microsoft.Mashup.Client.UI.Windows.DialogWindowBase.ShowModal(IWindowHandle windowHandle)
at Microsoft.Mashup.Client.UI.Shared.WebDialogs.WebDialog.<>n__0(IWindowHandle owner)
at Microsoft.Mashup.Client.UI.Shared.WebDialogs.WebDialog.<>c__DisplayClass57_0.<ShowModal>b__0()
at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
at Microsoft.Mashup.Client.UI.Shared.WebDialogs.WebDialog.ShowModal(IWindowHandle owner)
at Microsoft.Mashup.Client.Excel.QueriesEditorWindow.ShowModal(ILegacyUIHost uiHost, FormulaHistoryManager formulaHistoryManager, ApplicationTracingHost applicationTracingHost, ExcelServices excelServices, ConnectionManager connectionManager, DialogManager dialogManager, FillManager fillManager, PackageManager packageManager, IFileDialogManager fileDialogManager, ITelemetryService telemetryService, IWindowHandle ownerWindow, IWorkbookIdentity workbookIdentity, QueriesEditorParameters queriesEditorParameters, Queries queries)
at Microsoft.Mashup.Client.Excel.UI.LegacyMashupClientUIServices.ShowQueriesEditorWindow(IWindowHandle ownerWindow, IWorkbookIdentity workbookIdentity, QueriesEditorParameters queriesEditorParameters, IQueryServices queryServices, Queries queries)
at Microsoft.Mashup.Client.Excel.QueriesEditorWindowManager.ShowModalQueriesEditorWindow(IWindowHandle ownerWindow, IWorkbookIdentity workbookIdentity, QueriesEditorParameters queriesEditorParameters, Queries queries, IUndoScope undoScope)
at Microsoft.Mashup.Client.Excel.QueriesEditorWindowManager.<>c__DisplayClass14_1.<ShowModalQueriesEditorWindow>b__1(IUndoScope undoScope)
at Microsoft.Mashup.Client.Excel.Shim.NativeUndoServices.<>c__DisplayClass6_0.<InvokeUndoableAction>b__0()
at Microsoft.Mashup.Client.Excel.Shim.NativeWorkbookStorageServices.Microsoft.Mashup.Client.Excel.Shim.IDeferredStorageInvoker.InvokeDeferredStorageAction(IWorkbook workbook, Action action)
at Microsoft.Mashup.Client.Excel.Shim.NativeCoAuthServices.InvokeCoauthAction(IWorkbook workbook, UndoableActionType actionType, Action action)
at Microsoft.Mashup.Client.Excel.Shim.NativeUndoServices.InvokeUndoableAction(IWorkbook workbook, UndoableActionType actionType, Action`1 action)
at Microsoft.Mashup.Client.Excel.QueriesEditorWindowManager.<>c__DisplayClass14_0.<ShowModalQueriesEditorWindow>b__0()
at Microsoft.Mashup.Client.Excel.Shim.NativeCoAuthServices.NotifyGetDataPresence(IWorkbook workbook, Action action)
at Microsoft.Mashup.Client.Excel.QueriesEditorWindowManager.ShowModalQueriesEditorWindow(IWindowHandle ownerWindow, IWorkbookIdentity workbookIdentity, QueriesEditorParameters queriesEditorParameters, Queries queries)
at Microsoft.Mashup.Client.Excel.DialogManager.TryShowModalEditor(IWindowHandle ownerWindow, IWorkbook workbook, Query query, Boolean isNewQuery, Boolean navigatorExpanded)
at Microsoft.Mashup.Client.Excel.ExcelQueryServices.<>c__DisplayClass35_0.<EditQuery>b__0(IWorkbook workbook)
at Microsoft.Mashup.Client.Excel.ExcelQueryServices.TryInvokeOnWorkbook(Action`1 action)
at Microsoft.Mashup.Client.Excel.ExcelQueryServices.EditQuery(Query query, Boolean invokeAsFunction)
at Microsoft.Mashup.Client.Excel.ExcelRibbonHandler.OnEditQueryAction(IWindowContext windowContext)
at Microsoft.Mashup.Client.Excel.NativeRibbonHandler.<>c__DisplayClass6_0.<OnRibbonButtonAction>b__0()
at Microsoft.Mashup.Client.Excel.NativeRibbonHandler.<>c__DisplayClass17_0.<InvokeRibbonActionAndHandleExceptions>b__0()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at Microsoft.Mashup.Client.Excel.NativeRibbonHandler.InvokeRibbonActionAndHandleExceptions(Action action)
at Microsoft.Mashup.Client.Excel.NativeRibbonHandler.OnRibbonButtonAction(IntPtr uiFrame, Int32 buttonID)
at Microsoft.Mashup.Client.Excel.NativeRibbonCallbacks.<>c__DisplayClass3_0.<OnRibbonButtonActionCallback>b__0()
at Microsoft.Mashup.Client.Excel.Native.NativeExcelCallbackInvoker.InvokeAndReturnHResult(Action action)
at Microsoft.Mashup.Client.Excel.NativeRibbonCallbacks.OnRibbonButtonActionCallback(IntPtr uiFrame, Int32 buttonID)


Supports Premium Content:
True

Formulas:


section Section1;

shared #"Load_Source_File (2)" = let
FilePath = Excel.CurrentWorkbook(){[Name="IASummaryDirectory"]}[Content]{0}[Column1],
FileName = Excel.CurrentWorkbook(){[Name="IASummaryFilename"]}[Content]{0}[Column1],
Source = Csv.Document(File.Contents(FilePath & FileName),[Delimiter=",", Columns=57, Encoding=1252, QuoteStyle=QuoteStyle.None])
in
Source;

shared #"Client_View (2)" = let
Source = #"Load_Source_File (2)",
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Quarter Opn Market Value (CAD)", Int64.Type}, {"Quarter End Market Value (CAD)", Int64.Type}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type1", each ([#"Quarter End Market Value (CAD)"] <> 0) and Text.End([#"W360 Account No/Sleeve No"],2) <> "ZZ"),
#"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"Performance ROR (%) Quarter", type number}, {"Benchmark ROR (%) Quarter", type number}, {"Performance ROR (%) YTD", type number}, {"Benchmark ROR (%) YTD", type number}, {"Performance ROR (%) 1 Year", type number}, {"Benchmark ROR (%) 1 Year", type number}, {"Performance ROR (%) 3 Years", type number}, {"Benchmark ROR (%) 3 Year", type number}, {"Performance ROR (%) 5 Years", type number}, {"Benchmark ROR (%) 5 Year", type number}, {"Performance ROR (%) 7 Years", type number}, {"Benchmark ROR (%) 7 Year", type number}, {"Performance ROR (%) 10 Years", type number}, {"Benchmark ROR (%) 10 Years", type number}, {"Performance ROR (%) Since Incp", type number}, {"Benchmark ROR (%) Since Incp", type number}, {"Calendar Yr. Return (%) 1 Year", type number}, {"Calendar Yr. Return (%) 2 Year", type number}, {"Calendar Yr. Return (%) 3 Year", type number}, {"Calendar Yr. Return (%) 4 Year", type number}, {"Calendar Yr. Return (%) 5 Year", type number}, {"Calendar Yr. Return (%) 6 Year", type number}, {"Calendar Yr. Return (%) 7 Year", type number}, {"Calendar Yr. Return (%) 8 Year", type number}, {"Calendar Yr. Return (%) 9 Year", type number}, {"Calendar Yr. Return (%)10 Year", type number}, {"CDN Cash and Equivalents", type number}, {"US Cash and Equivalents", type number}, {"Intern'l Cash and Equivalents", type number}, {"Emerging Cash and Equivalents", type number}, {"CDN Fixed Income", type number}, {"US Fixed Income", type number}, {"Intern'l Fixed Income", type number}, {"Emerging Fixed Income", type number}, {"CDN Equity", type number}, {"US Equity", type number}, {"Intern'l Equity", type number}, {"Emerging Equity", type number}, {"CDN Other", type number}, {"US Other", type number}, {"Intern'l Other", type number}, {"Emerging Other", type number}, {"Total", type number}, {"FX Rate", type number}}),
#"Replaced Errors" = Table.ReplaceErrorValues(#"Changed Type", {{"Performance ROR (%) Quarter", -999999}, {"Benchmark ROR (%) Quarter", -999999}, {"Performance ROR (%) YTD", -999999}, {"Benchmark ROR (%) YTD", -999999}, {"Performance ROR (%) 1 Year", -999999}, {"Benchmark ROR (%) 1 Year", -999999}, {"Performance ROR (%) 3 Years", -999999}, {"Benchmark ROR (%) 3 Year", -999999}, {"Performance ROR (%) 5 Years", -999999}, {"Benchmark ROR (%) 5 Year", -999999}, {"Performance ROR (%) 7 Years", -999999}, {"Benchmark ROR (%) 7 Year", -999999}, {"Performance ROR (%) 10 Years", -999999}, {"Benchmark ROR (%) 10 Years", -999999}, {"Performance ROR (%) Since Incp", -999999}, {"Benchmark ROR (%) Since Incp", -999999}, {"Calendar Yr. Return (%) 1 Year", -999999}, {"Calendar Yr. Return (%) 2 Year", -999999}, {"Calendar Yr. Return (%) 3 Year", -999999}, {"Calendar Yr. Return (%) 4 Year", -999999}, {"Calendar Yr. Return (%) 5 Year", -999999}, {"Calendar Yr. Return (%) 6 Year", -999999}, {"Calendar Yr. Return (%) 7 Year", -999999}, {"Calendar Yr. Return (%) 8 Year", -999999}, {"Calendar Yr. Return (%) 9 Year", -999999}, {"Calendar Yr. Return (%)10 Year", -999999}})
in
#"Replaced Errors";

andreben
New Member

Thanks, sse below the details! (no pending updates)

 

Feedback Type:
Frown (Error)

Error Message:
Invalid character in the given encoding. Line 1, position 1.

Stack Trace:
System.Xml.XmlException
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at System.Windows.Forms.WindowsFormsSynchronizationContext.Send(SendOrPostCallback d, Object state)
at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.AllowModalDialogs(Action action)
at Microsoft.PowerBI.Client.Windows.LiveConnectHelpers.LiveConnectionPropertiesValidator.TryGetValidLiveConnectionProperties(IPowerBIWindowService windowService, ILiveConnectionProperties connectionProperties, Report report, ILiveConnectionCompleter liveConnectionPropertiesCompleter, ILiveConnectionProperties& validLiveConnectionProperties, Boolean& resultIsSameConnection, ValidationStatus& validationStatus)
at Microsoft.PowerBI.Client.Windows.ReportPreparer.ValidateLiveConnectionProperties(Report report, IPowerBIWindowService windowService, Boolean& isSameConnection, ValidationStatus& validationStatus)
at Microsoft.PowerBI.Client.Windows.ReportPreparer.<Prepare>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Client.Windows.Services.PowerBIPackagingService.<Open>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Client.Windows.Services.FileManager.<LoadFromPbix>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Client.Windows.Services.FileManager.<>c__DisplayClass20_0.<<OpenFile>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.<>c__DisplayClass13_0`1.<<BlockUIAndRun>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.WaitOnUIThreadForTaskCompletion[T](Task`1 task)
at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.BlockUIAndRun[T](Func`1 asyncMethod)
at Microsoft.PowerBI.Client.Windows.Services.FileManager.OpenFile(IPowerBIWindowService windowService, IPowerBIFile fileToOpen, Nullable`1 entryPoint)
at Microsoft.PowerBI.Client.Program.TryOpenOrCreateReport(IPowerBIWindowService windowService, IFileManager fileManager, IFileHistoryManager fileHistoryManager, CommandLine commandLine, FileType fileType, IFileInformationProtectionManager fileInformationProtectionManager, IPowerBITelemetryService telemetryService)
at Microsoft.PowerBI.Client.Program.<>c__DisplayClass4_1.<Main>b__3()
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass3_0.<HandleExceptionsWithNestedTasks>b__0()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)

Stack Trace Message:
Invalid character in the given encoding. Line 1, position 1.

Invocation Stack Trace:
at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
at Microsoft.Mashup.Client.UI.Shared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace, String exceptionMessage)
at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.GetStackTraceInfo(Exception e)
at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.ReportException(IWindowHandle activeWindow, IUIHost uiHost, FeedbackPackageInfo feedbackPackageInfo, Exception e, Boolean useGDICapture)
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.<>c__DisplayClass14_0.<HandleException>b__0()
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.HandleException(Exception e)
at Microsoft.PowerBI.Client.PowerBIUnexpectedExceptionHandler.HandleException(Exception e)
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at Microsoft.PowerBI.Client.Program.Main(String[] args)


PowerBINonFatalError:
{"AppName":"PBIDesktop","AppVersion":"2.112.1161.0","ModuleName":"Microsoft.PowerBI.Client.Windows.dll","Component":"Microsoft.PowerBI.Client.Windows.Services.UIBlockingService","Error":"System.Xml.XmlException","MethodDef":"AllowModalDialogs","ErrorOffset":"43"}

PowerBIUserFeedbackServices_IsReported:
True

amitchandak
Super User
Super User

@andreben ,Please click on Copy details to clipboard and paste it here.

Make sure no windows updates are pending. If pending install those first.

 

 

Also, log an issue - https://community.powerbi.com/t5/Issues/idb-p/Issues

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.