Hi ,
I have an annoying error showing up in PowerPivot which is not letting me to build any DAX functions in PowerPivot, please help me.
Any time I go to create a formula I get an error "Â Unhandled exception has occurred in a component in your application. Â If you click Continue, the application will ignore this error and attempt to continue. Details below.
----------------------------------------------------------------------------------------------------------
See the end of this message for details on invoking
 just-in-time (JIT) debugging instead of this dialog box.
 ************** Exception Text **************
 System.InvalidCastException: Return argument has an invalid type.
  at System.Runtime.Remoting.Proxies.RealProxy.ValidateReturnArg(Object arg, Type paramType)
  at System.Runtime.Remoting.Proxies.RealProxy.PropagateOutParameters(IMessage msg, Object[] outArgs, Object returnValue)
  at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
  at Microsoft.Office.Interop.Excel._Application.get_ActiveWorkbook()
  at Microsoft.AnalysisServices.XLHost.Addin.GeminiRibbon.currentClientWindow_InFormulaBarChanged(Object sender, EventArgs e)
  at Microsoft.AnalysisServices.XLHost.Modeler.ClientWindow.OnInFormulaBarChanged()
  at Microsoft.AnalysisServices.XLHost.Modeler.ClientWindow.sandboxEditor_InFormulaBarChanged(Object sender, EventArgs e)
  at Microsoft.AnalysisServices.Common.SandboxEditor.OnInFormulaBarChanged(EventArgs e)
  at Microsoft.AnalysisServices.Common.SandboxEditor.formulaBar_Enter(Object sender, EventArgs e)
  at System.EventHandler.Invoke(Object sender, EventArgs e)
  at System.Windows.Forms.Control.OnEnter(EventArgs e)
  at System.Windows.Forms.Control.NotifyEnter()
  at System.Windows.Forms.ContainerControl.UpdateFocusedControl()
 ************** Loaded Assemblies **************
 mscorlib
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
 ----------------------------------------
 Microsoft.VisualStudio.Tools.Office.Runtime.Internal
   Assembly Version: 10.0.0.0
   Win32 Version: 10.0.60301.0
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Office.Runtime.Internal/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Office.Runtime.Internal.dll
 ----------------------------------------
 System
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34238 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
 ----------------------------------------
 System.Configuration
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
 ----------------------------------------
 System.Xml
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
 ----------------------------------------
 Microsoft.VisualStudio.Tools.Applications.Runtime
   Assembly Version: 10.0.0.0
   Win32 Version: 10.0.60301.0
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
 ----------------------------------------
 System.Core
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
 ----------------------------------------
 Microsoft.Office.Tools
   Assembly Version: 10.0.0.0
   Win32 Version: 10.0.60301.0
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.dll
 ----------------------------------------
 Microsoft.Office.Tools.Excel.Implementation
   Assembly Version: 10.0.0.0
   Win32 Version: 10.0.60301.0
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.Excel.Implementation/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Excel.Implementation.dll
 ----------------------------------------
 Microsoft.Office.Tools.Common.Implementation
   Assembly Version: 10.0.0.0
   Win32 Version: 10.0.60301.0
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.Common.Implementation/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Common.Implementation.dll
 ----------------------------------------
 Microsoft.Office.Tools.Common
   Assembly Version: 10.0.0.0
   Win32 Version: 10.0.60301.0
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.Common/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Common.dll
 ----------------------------------------
 System.Drawing
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34270 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
 ----------------------------------------
 System.Windows.Forms
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34251 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
 ----------------------------------------
 Microsoft.AnalysisServices.XLHost.Addin
   Assembly Version: 11.0.0.0
   Win32 Version: 11.0.3000.0 ((SQL11_PCU_Main).121019-1322 )
   CodeBase: file:///C:/Program%20Files/Microsoft%20Analysis%20Services/AS%20Excel%20Client/110/Microsoft.AnalysisServices.XLHost.Addin.DLL
 ----------------------------------------
 Microsoft.Office.Tools.Common.v4.0.Utilities
   Assembly Version: 10.0.0.0
   Win32 Version: 10.0.30319.1
   CodeBase: file:///C:/Program%20Files/Microsoft%20Analysis%20Services/AS%20Excel%20Client/110/Microsoft.Office.Tools.Common.v4.0.Utilities.DLL
 ----------------------------------------
 Microsoft.Office.Tools.Excel
   Assembly Version: 10.0.0.0
   Win32 Version: 10.0.60301.0
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.Excel/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Excel.dll
 ----------------------------------------
 Microsoft.AnalysisServices.XLHost.Modeler.O14
   Assembly Version: 11.0.0.0
   Win32 Version: 11.0.3000.0 ((SQL11_PCU_Main).121019-1322 )
   CodeBase: file:///C:/Program%20Files/Microsoft%20Analysis%20Services/AS%20Excel%20Client/110/Microsoft.AnalysisServices.XLHost.Modeler.O14.DLL
 ----------------------------------------
 Microsoft.AnalysisServices.Common.O14
   Assembly Version: 11.0.0.0
   Win32 Version: 11.0.3000.0 ((SQL11_PCU_Main).121019-1322 )
   CodeBase: file:///C:/Program%20Files/Microsoft%20Analysis%20Services/AS%20Excel%20Client/110/Microsoft.AnalysisServices.Common.O14.DLL
 ----------------------------------------
 Microsoft.AnalysisServices.Common.FrontEnd.O14
   Assembly Version: 11.0.0.0
   Win32 Version: 2011.0110.3000.00 ((SQL11_PCU_Main).121019-1301)
   CodeBase: file:///C:/Program%20Files/Microsoft%20Analysis%20Services/AS%20Excel%20Client/110/Microsoft.AnalysisServices.Common.FrontEnd.O14.DLL
 ----------------------------------------
 Accessibility
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
 ----------------------------------------
 Microsoft.AnalysisServices.BackEnd.O14
   Assembly Version: 11.0.0.0
   Win32 Version: 2011.0110.3000.00 ((SQL11_PCU_Main).121019-1301)
   CodeBase: file:///C:/Program%20Files/Microsoft%20Analysis%20Services/AS%20Excel%20Client/110/Microsoft.AnalysisServices.BackEnd.O14.DLL
 ----------------------------------------
 Microsoft.CSharp
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.CSharp/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll
 ----------------------------------------
 Microsoft.DataWarehouse
   Assembly Version: 11.0.0.0
   Win32 Version: 11.0.3000.0 ((SQL11_PCU_Main).121019-1322 )
   CodeBase: file:///C:/Program%20Files/Microsoft%20Analysis%20Services/AS%20Excel%20Client/110/Microsoft.DataWarehouse.DLL
 ----------------------------------------
 Anonymously Hosted DynamicMethods Assembly
   Assembly Version: 0.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
 ----------------------------------------
 System.Dynamic
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dll
 ----------------------------------------
 Microsoft.AnalysisServices.BackEnd.XmlSerializers.O14
   Assembly Version: 11.0.0.0
   Win32 Version: 2011.0110.3000.00 ((SQL11_PCU_Main).121019-1301)
   CodeBase: file:///C:/Program%20Files/Microsoft%20Analysis%20Services/AS%20Excel%20Client/110/Microsoft.AnalysisServices.BackEnd.XmlSerializers.O14.DLL
 ----------------------------------------
 System.Data
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
 ----------------------------------------
 Microsoft.GeneratedCode
   Assembly Version: 1.0.0.0
   Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
 ----------------------------------------
 WindowsBase
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
 ----------------------------------------
 System.Runtime.Serialization
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
 ----------------------------------------
 Microsoft.AnalysisServices
   Assembly Version: 11.0.0.0
   Win32 Version: 11.0.3000.0 ((SQL11_PCU_Main).121019-1322 )
   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.AnalysisServices/11.0.0.0__89845dcd8080cc91/Microsoft.AnalysisServices.dll
 ----------------------------------------
 WindowsFormsIntegration
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsFormsIntegration/v4.0_4.0.0.0__31bf3856ad364e35/WindowsFormsIntegration.dll
 ----------------------------------------
 PresentationFramework
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.dll
 ----------------------------------------
 PresentationCore
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/PresentationCore/v4.0_4.0.0.0__31bf3856ad364e35/PresentationCore.dll
 ----------------------------------------
 System.Xaml
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xaml/v4.0_4.0.0.0__b77a5c561934e089/System.Xaml.dll
 ----------------------------------------
 System.Transactions
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
 ----------------------------------------
 System.Numerics
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
 ----------------------------------------
 Microsoft.AnalysisServices.AdomdClient
   Assembly Version: 11.0.0.0
   Win32 Version: 11.0.3000.0 ((SQL11_PCU_Main).121019-1322 )
   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.AnalysisServices.AdomdClient/11.0.0.0__89845dcd8080cc91/Microsoft.AnalysisServices.AdomdClient.dll
 ----------------------------------------
 Microsoft.SqlServer.Configuration.SString
   Assembly Version: 11.0.0.0
   Win32 Version: 11.0.3000.0 ((SQL11_PCU_Main).121019-1322 )
   CodeBase: file:///C:/Program%20Files/Microsoft%20Analysis%20Services/AS%20Excel%20Client/110/Microsoft.SqlServer.Configuration.SString.DLL
 ----------------------------------------
 msmgdsrv
   Assembly Version: 9.0.0.0
   Win32 Version: 2011.0110.3000.00
   CodeBase: file:///C:/Program%20Files/Microsoft%20Analysis%20Services/AS%20OLEDB/110/msmgdsrv.dll
 ----------------------------------------
 SMDiagnostics
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/SMDiagnostics/v4.0_4.0.0.0__b77a5c561934e089/SMDiagnostics.dll
 ----------------------------------------
 System.ServiceModel.Internals
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ServiceModel.Internals/v4.0_4.0.0.0__31bf3856ad364e35/System.ServiceModel.Internals.dll
 ----------------------------------------
 Microsoft.AnalysisServices.Common.FrontEnd.XmlSerializers.O14
   Assembly Version: 11.0.0.0
   Win32 Version: 2011.0110.3000.00 ((SQL11_PCU_Main).121019-1301)
   CodeBase: file:///C:/Program%20Files/Microsoft%20Analysis%20Services/AS%20Excel%20Client/110/Microsoft.AnalysisServices.Common.FrontEnd.XmlSerializers.O14.DLL
 ----------------------------------------
 ************** JIT Debugging **************
 To enable just-in-time (JIT) debugging, the .config file for this
 application or computer (machine.config) must have the
 jitDebugging value set in the system.windows.forms section.
 The application must also be compiled with debugging
 enabled.
 For example:
 <configuration>
   <system.windows.forms jitDebugging="true" />
 </configuration>
 When JIT debugging is enabled, any unhandled exception
 will be sent to the JIT debugger registered on the computer
 rather than be handled by this dialog box.