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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

[help] sankey image can't be displayed in poweBI

Hi team, 

I have below script.

 

 

import pandas as pd
import chart_studio.plotly as py
import plotly.graph_objects as go
labelListTemp1 = list(set(dataset.source.values))
labelListTemp2 = list(set(dataset.target.values))
labelList = labelListTemp1 + labelListTemp2
sankey_node = list(dict.fromkeys(labelList))
fig = go.Figure(data=[go.Sankey( node = dict( pad=15, 
                                             thickness=20, 
                                             line = dict(color = "black", width = 0.5),
                                             label = labelList,
                                             color = "blue" ),
                                              link = dict(source = dataset.source.apply(lambda x: labelList.index(x)),
                                                          target = dataset.target.apply(lambda x: labelList.index(x)),
                                                          value = dataset.value))])

fig.show()

 

 

 

 And I run it in powerBI with enabling python script. but the result is that the code opened a browser and displayed the sankey in browser, instead of  in powerBI.

1. the code opened a browser and displayed the sankey in browser.

2. I would like the sankey chart displayed in powerBI, but powerBI says that  'the visual can't be displayed'.

cheriemilk_1-1643012253430.png

 

 

Is there anyone that succesfully created sankey chart by python plotly lib?  can any expert help take a look what's wrong here?

 

Thanks,

Cherie

0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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