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

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

Reply
FilipFireFlyBI
Resolver I
Resolver I

Titanic dataset visuals with Python in Power BI

Hi all,

 

I try to import titanic dataset in Power BI, and make some basic Python visualisations.

In the query editor I can succelfully import the dataset using this Python code:

 

   import pandas as pd
   url = "http://biostat.mc.vanderbilt.edu/wiki/pub/Main/DataSets/titanic3.xls"
   titanic_df = pd.read_excel(url)
  

 

Then I load the data to the Power BI report, so I choose for a Phython visual type.

I want some basic visualisations using the Survived column, so I add column Survived in the values pane of the Phython visual type. Now I enter this code:

 

# dataset = pandas.DataFrame(age)

# dataset = dataset.drop_duplicates()

# Paste or type your script code here:

import numpy as np

import pandas as pd

import seaborn as sns

sns.set_style('whitegrid')

ax = sns.countplot(x='survived', data=titanic_df)

 

even with changing data=titanic_df to data=dataset I don't get a result.

I Jupyter notebooks this works fine. Python and the 3 packages (np,pd,sns) are installed on my machine and seem to work for other very small datasets (like a self constructed small dataframe of shape 2*2).

Anyone who knows how to do this? 

Thanks in advance!

 

titanic_PBI_Desktop.PNG

1 REPLY 1
dax
Community Support
Community Support

Hi FilipFiN,

If possible, could you please inform me the detailed error information? You could click the "See details" to get the detailed error information.

Best Regards,
Zoe Zhi

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.