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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Measure created in dataset when report already has the same measure

To reproduce:

 

  1. Create a new report using existing dataset
  2. Create new measure in report
    1. i.e. in table 'users' and a name it 'Users Count'
  3. Create a visualization using the new measure
  4. Update the underlying dataset and create a new measure
    1. use the same table and name as you did in the report ('users' -> 'Users Count')

 

Error:

 

Now you will get an error in Field:

 

The name 'x' is already used for measure on table 'y'. Choose a different name

 


When you try to rename it, you get a dialog:

 

Something went wrong

An error occured while rendering the report

 

 

Error details:

 

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:298936:43)
    at RenameDeleteMenuItemHandlers.capabilitiesCheck (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:149969:55)
    at RenameDeleteMenuItemHandlers.getHandlers (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:149954:51)
    at FieldListMenuStrategy.getItemMenuHandlers (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:151458:94)
    at FieldListMenuStrategy.getMenu (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:151450:83)
    at https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:333401:52
    at PbiTreeComponent.handleMenuOperation (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:333379:113)
    at PbiTreeComponent.handleContextMenu (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:333367:26)
    at PbiTreeNodeComponent.handleContextMenu (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:333984:56)
    at https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:333946:40

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.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.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__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)
   at Microsoft.PowerBI.Client.Program.Main(String[] args)


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

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

AS Live Connection:
True

 

 

Status: Needs Info

Hi @tsolbjor 

For the fourth step , Update the underlying dataset , but I have a doubt , if we use dataset as a datasource and then create a report , publish the report to Service , it doesn't generate a dataset, so I'm confused about the update underlying dataset you mentioned.

 

Best Regards,
Community Support Team _ Ailsa Tao

Comments
v-yetao1-msft
Community Support
Status changed to: Needs Info

Hi @tsolbjor 

For the fourth step , Update the underlying dataset , but I have a doubt , if we use dataset as a datasource and then create a report , publish the report to Service , it doesn't generate a dataset, so I'm confused about the update underlying dataset you mentioned.

 

Best Regards,
Community Support Team _ Ailsa Tao

tsolbjor
Frequent Visitor

The "underlying dataset" is referring to the existing dataset that we connected to in step 1.

 

 

 

 

SMHolck
Advocate IV

We are also having this same problem.

To recreate: 

1. Create a report in PBI Desktop that uses a shared dataset.

2. Add a measure to the report called "Test1" = TRUE()

3. Add a visual that shows the measure

4. Publish the report to Power BI service

5. Add a measure to the shared dataset with the same name "Test1" with the same formula

6. Publish the dataset to Power BI service

7. View the report on Power BI Service  and get 

SMHolck_1-1680643332430.png

 

8. Open the report in Power BI desktop - see error

9. Attempt to rename the report measure to Test2 by Right-clicking on the measure, can't even get the menu option just get (interestingly, if the value is on another table, you can rename the original report formula just not if it is in the same home table as the report formula)

SMHolck_0-1680642525770.png

Feedback Type:
Frown (Error)

Error Message:
An error occurred while rendering the report.

Stack Trace:
Javascript&colon; TypeError
at canRename (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:298936:43)
at RenameDeleteMenuItemHandlers.capabilitiesCheck (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:149969:55)
at RenameDeleteMenuItemHandlers.getHandlers (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:149954:51)
at FieldListMenuStrategy.getItemMenuHandlers (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:151458:94)
at FieldListMenuStrategy.getMenu (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:151450:83)
at https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:333401:52
at PbiTreeComponent.handleMenuOperation (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:333379:113)
at PbiTreeComponent.handleContextMenu (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:333367:26)
at PbiTreeNodeComponent.handleContextMenu (https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:333984:56)
at https://ms-pbi.pbi.microsoft.com/minerva/scripts/desktop.js:333946:40

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.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.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__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)
at Microsoft.PowerBI.Client.Program.Main(String[] args)


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

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

AS Live Connection:
True

SMHolck
Advocate IV

@tsolbjor - I managed to work around this by renaming the measure in the dataset and publishing to a dev workspace, then I opened the report and removed the original measure with the same name, rename in the dataset to the measure name you want, republish, and add back to the report.  It's a total pain, but it can get you by until Microsoft fixes this bug in PBI Desktop's javascript libraries.  

Maybe send the frowns to convince them to fix it? 🙂

DougieK
Frequent Visitor

We also have a similar issue.  

 

Dataset P_Invoice

Dataset P_SalesOrder

 

We joined these in a DirectQuery for Report1. 

 

***Months later we added measure 'Count of Customers' to P_Invoice and P_SalesOrder.

 

Then we go back to do some basic maintenance on Report1.  We hit Refresh on the desktop file and we get the dreaded message...

 

DirectQuery to AS - P_Invoice
'The name 'Count of Customers' is already in use for a measure on the table 'Invoice'.  Choose a different name.  


DirectQuery to AS - P_SalesOrder

'The name 'Count of Customers' is already in use for a measure on the table 'Invoice'.  Choose a different name.  

 

For clarity sake, table 'Invoice' only exists in P_Invoice.  However, both datasets had measure 'Count of Customers' added to them after we initially made Report1.

 

I think Power BI has no problem with the same measure name across datasets in a DirectQuery as long as they exist when the DirectQuery is created.  But when measures with the same name are added later it doesn't know how to handle it.

 

We've been dealing with this by simply deleting the datasets used in the DirectQuery and reconnecting to them.  No problems except it's a pain rebuilding the report and whatever may have broken.