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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Master_T
Helper I
Helper I

VisualUpdate doesn't fire in custom visual when switching from reading to edit mode

I'm developing a custom visual where I need to detect if the report is in reading view or edit view, since I want to show a different button depending on the current View Mode.

According to the documentation, when the view mode changes the visual's update() method should get called, with the value of the options.type parameter set to powerbi.VisualUpdateType.ViewMode

However, from my tests this only happens when switching from edit to view mode.

When switching from view to edit mode, the update() method is not called.


Is this a bug in the PowerBI service/api? How do I solve this?

Here's a snippet of the update() method of my visual for reference:

 

public update(options: VisualUpdateOptions) {
	if (powerbi.VisualUpdateType.ViewMode === (options.type & powerbi.VisualUpdateType.ViewMode) ) {
		//we never get here when switching from reading view to edit view 
		//it only works when switching from edit view to reading view
	}
}

 

 

 

 

5 REPLIES 5
Anonymous
Not applicable

HI @Master_T,

I think this function is working as expected.

When you enter editor mode, power bi only needs to loop current report contents and set them editable.

For these parts of operations, power bi did not require to consider to keep/reset current changes so power bi hasn't reloaded and reset the report content and changes. (the update function not triggered)

When you try to exit the edit mode, power bi needs to confirm if you keep or reject these changes. (both two choices will invoke the update features)
Regards,

Xiaoxin Sheng

That's all well and good... but what if I want to show a slighlty different UI depending on whether the visual is in reading or edit view? I want to show an extra button in my visual if I am in edit mode, but if it is "working as intended" there is no way to detect if I'm entering edito mode... not a very smart implementation if that is the case, in my opinion.

Anonymous
Not applicable

HI @Master_T,

Perhaps you can submit an idea for improving this update function and feature usage to help achieve your requirement.

Microsoft Power BI ideas
Regards,

Xiaoxin Sheng

dm-p
Super User
Super User

Hi @Master_T

It's difficult to determine if it's a bug, or where it's just a requirement that has never come up. I'm trying to temember if it ever did this, as I may have experimented with this idea in the past, but I can't be sure.

Either way, it sounds like it would be useful to have, particularly if it works the other way. I'd suggest creating an issue so the team can be aware it's soemthing you're looking for.

Regards,

Daniel





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

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.