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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jamesbla-ms
Microsoft Employee
Microsoft Employee

Power BI Client for React and Browser History

We have a web application that uses powerbi-client-react 1.4.0 to load an embedded report. The user flow is as follows:

  1. User selects a report from a list of reports
  2. The browser navigates
  3. The embedded report renders

The issue reported by our users is that, once the report actually loads in the browser, an extra entry is added to the browser back button history. This means that to get back to the list of reports, they need to hit the back button twice, which they do not like.

 

This extra history item is added when the PowerBIEmbed control actually starts loading the report from PowerBI and the report chrome appears in the browser. Until that moment, the browser history is correct.

 

Is there a way to prevent this extra entry from being pushed into the history?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @jamesbla-ms ,

 

You might consider trying to use the history.replaceState method when you first start loading the report to replace the current history entry with a new one, preventing the creation of additional entries.

 // Before loading the report
    history.replaceState(null, document.title, location.href);
    // Load the Power BI report
    powerbi.embed(reportContainer, embedConfig);

And you may also try to check your embed configuration is optimized to avoid unnecessary navigation changes. Sometimes, tweaking the configuration can help reduce unwanted history entries.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi  @jamesbla-ms ,

 

You might consider trying to use the history.replaceState method when you first start loading the report to replace the current history entry with a new one, preventing the creation of additional entries.

 // Before loading the report
    history.replaceState(null, document.title, location.href);
    // Load the Power BI report
    powerbi.embed(reportContainer, embedConfig);

And you may also try to check your embed configuration is optimized to avoid unnecessary navigation changes. Sometimes, tweaking the configuration can help reduce unwanted history entries.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.