Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
Could you please advise how to resolve this error? My Python script works fine in Databrics, however, when I run it in Power BI it opens up the visual in the browser window instead and gives me this error:
Here is the code:
import pandas as pd
import plotly.express as px
# Create a DataFrame
dataset = pd.DataFrame(dataset)
# Convert 'End Date' and 'Start Date' to datetime objects
dataset['End Date'] = pd.to_datetime(dataset['End Date'])
dataset['Start Date'] = pd.to_datetime(dataset['Start Date'])
# Calculate the difference in days between 'End Date' and 'Start Date'
dataset['diff'] = (dataset['End Date'] - dataset['Start Date']).dt.days
# Reverse the DataFrame to match the reversed y-axis labels
dataset = dataset.iloc[::-1].reset_index(drop=True)
# Create a figure and axis
fig = px.timeline(dataset, x_start="Start Date", x_end="End Date", y="Event Description", color="Group Name",
hover_data={"Start Date": "|%Y-%m-%d", "End Date": "|%Y-%m-%d"},
labels={"Start Date": "Start Date", "End Date": "End Date"})
# Update layout
fig.update_layout(
title='Timeline',
xaxis=dict(
title='Date',
tickformat='%Y'
),
yaxis=dict(
title='Group Name'
)
)
# Show the figure
fig.show()
Solved! Go to Solution.
You cannot bring your own renderer, you need to use the default renderer.
Create Power BI visuals using Python in Power BI Desktop - Power BI | Microsoft Learn
This is annoying as Plotly is the only option that provides interactive visual 😕 Thanks for your response.
If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com/?forum=2d80fd4a-16cb-4189-896b-e0dac5e08b41
You cannot bring your own renderer, you need to use the default renderer.
Create Power BI visuals using Python in Power BI Desktop - Power BI | Microsoft Learn
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |