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
RobinVanBeijnum
New Member

Broken measures in pbix - not visible in Tabular Editor and DAX Studio

Hi all,

 

We are facing quite an annoying issue with one of our Power BI files; we have some hidden measures in the report that are broken, but we are unable to remove them. The report generates an error whenever we want to touch one of these measures (see below) and as stated in the subject, these measures do not appear in Tabular Editor nor DAX Studio. 

 

I tried to search for a solution, but to no avail so far. Anyone able to help us out?

 

Error:

Feedback Type:
Frown (Error)

Error Message:
An error occurred while rendering the report.

Stack Trace:
Javascript:TypeError
at canRename (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:463310:43)
at RenameDeleteMenuItemHandlers.capabilitiesCheck (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:352699:55)
at RenameDeleteMenuItemHandlers.getHandlers (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:352684:51)
at FieldListMenuStrategy.getItemMenuHandlers (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:353292:94)
at FieldListMenuStrategy.getMenu (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:353278:83)
at https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:516445:52
at PbiTreeComponent.handleMenuOperation (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:516423:113)
at PbiTreeComponent.handleContextMenu (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:516412:26)
at https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:516143:108
at executeListenerWithErrorHandling (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:596520:69)

Stack Trace Message:
An error occurred while rendering the report.

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.PowerBI.Client.Windows.Utilities.PowerBIFormUnexpectedExceptionHandler.HandleException(Exception e)
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.PowerBI.Client.Windows.HostServiceDispatcher.<>c__DisplayClass15_0.<ExecuteInteropCsMethod>b__0()
at Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.<ExecuteInteropCsMethod>d__15.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.ExecuteInteropCsMethod(Object interopObj, MethodInfo method, Object[] arguments, Nullable`1 runOn, Nullable`1 jsonOptions)
at Microsoft.PowerBI.Client.Windows.WebView2.WebView2Interop.<>c__DisplayClass22_0.<<InvokeCsMethod>b__0>d.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.PowerBI.Client.Windows.WebView2.WebView2Interop.<>c__DisplayClass22_0.<InvokeCsMethod>b__0()
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<HandleAwaitableAsyncExceptions>d__1.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.HandleAwaitableAsyncExceptions(IExceptionHandler exceptionHandler, Func`1 asyncFunc)
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<HandleAsyncExceptions>d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.HandleAsyncExceptions(IExceptionHandler exceptionHandler, Func`1 asyncFunc)
at Microsoft.PowerBI.Client.Windows.WebView2.WebView2Interop.InvokeCs(InteropCall call)
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
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.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
at Microsoft.PowerBI.Client.Program.<>c__DisplayClass7_0.<RunApplicationLegacy>b__0()
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass3_0.<HandleExceptionsWithNestedTasks>b__0()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at Microsoft.PowerBI.Client.Program.RunApplicationLegacy(String[] args)
at Microsoft.PowerBI.Client.Program.Main(String[] args)


JS Error Message:
Cannot read properties of undefined (reading 'capabilities')

PowerBINonFatalError:
{"AppName":"PBIDesktop","AppVersion":"2.128.1177.0","ModuleName":"https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js","Component":"","Error":"TypeError","MethodDef":"canRename","ErrorOffset":"463310:43","ErrorCode":""}

Snapshot Trace Logs:
C:\Users\XXXXXXX\Microsoft\Power BI Desktop Store App\FrownSnapShot74719838-605c-487d-a5c8-ed04fb6b0c79.zip

Model Default Mode:
Composite

Model Version:
PowerBI_V3

Performance Trace Logs:
C:\Users\XXXXXXX\Microsoft\Power BI Desktop Store App\PerformanceTraces.zip

Enabled Preview Features:
PBI_sparklines
PBI_scorecardVisual
PBI_NlToDax
PBI_fieldParametersSuperSwitch
PBI_angularRls
PBI_backstageUI
PBI_setLabelOnExportPdf
PBI_dynamicFormatString
PBI_oneDriveSave
PBI_oneDriveShare
PBI_useModernPublishDialogs
PBI_gitIntegration
PBI_newCard
PBI_buttonSlicerAuthoring
PBI_mobileAutoReportLayout
PBI_daxQueryView
PBI_daxInlineCopilot
PBI_aiNarrativesVisual
PBI_generateMeasureDescriptionsButton
PBI_desktopReportAuthoringCopilot

Disabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_SpanishLinguisticsEnabled
PBI_qnaLiveConnect
PBI_b2bExternalDatasetSharing
PBI_enhancedTooltips
PBI_onObject
PBI_tmdlInDataset
PBI_EimLessElevatedUser
PBI_modelExplorer
PBI_qnaImproveLsdlCopilot
PBI_visualCalculationsAuthoring

Disabled DirectQuery Options:
TreatHanaAsRelationalSource

Cloud:
GlobalCloud

PowerBIUserFeedbackServices_IsReported:
True

Formulas:


section Section1;

[ Description = "Random text describing Excel input" ]shared Opinion = let
Source = Excel.Workbook(Web.Contents("https://an_address.xlsx"), null, true),
XX_Sheet = Source{[Item="Excel",Kind="Sheet"]}[Data],
#"Removed Datetime Columns" = Table.RemoveColumns(Opinions_Sheet,{"Column2", "Column3"}),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Datetime Columns", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"XX", Int64.Type}, {"XX", type text}, {"XX", type text}, {"XX", type date}, {"XX", type text}, {"XX", type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"XX", "XX"})
in
#"Removed Columns";

shared #"Data Dictionary" = let
Source = Excel.Workbook(Web.Contents("https://.xlsx"), null, true),
Sheet1_Sheet = Source{[Item="Sheet2 (2)",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"XX", type text}, {"XX", type text}})
in
#"Changed Type";

[ Description = "XX" ]shared Calculations = let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i44FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Column1"})
in
#"Removed Columns";

shared #"Watch Comments" = let
Source = Excel.Workbook(Web.Contents("https://.xlsx"), null, true),
XX_Sheet = Source{[Item="XX",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(XX_Sheet, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"XX", Int64.Type}, {"XX", type text}, {"XX", type text}, {"XX", type text}, {"XX", type text}}),
#"Removed Blank Rows" = Table.SelectRows(#"Changed Type", each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})))
in
#"Removed Blank Rows";

shared #"DirectQuery to AS - Report - SQL Server - Data" = let
Source = AnalysisServices.Database("powerbi://api.powerbi.com/v1.0/myorg/XX", "XX Report - XX - SQL Server - Data"),
Cubes = Table.Combine(Source[Data]),
Cube = Cubes{[Id="Model", Kind="Cube"]}[Data]
in
Cube;

Active Section Contract:
I deleted this part due to sensitive contents

3 REPLIES 3
DataInsights
Super User
Super User

@RobinVanBeijnum,

 

Try running this C# script in Tabular Editor. Replace "MyMeasure" with the measure you want to delete.

 

foreach (var m in Model.AllMeasures)
{
    if (m.Name == "MyMeasure")
    {
        m.Delete();
    }
}

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi DataInsights, Thanks for the quick reply and helping us out. Unfortunately it did not work, the caluclations are still there after running the C# script (see screenshot below). 

 

RobinVanBeijnum_0-1714388644727.png

 

@RobinVanBeijnum,

 

Just to confirm, you did click "Save changes back to the currently connected database"? You might try saving the pbix as a pbip and then try removing the measures from the pbip.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
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.