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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi all,
I have a Power BI report built from a dataflow (that I don't have admin access to). Within Power Query, I have applied a script to one of the tables from this flow. I have then published it to Power BI Service.
I am getting the below error:
As such, I suspect the issue is related to my Python script. I have a couple of questions:
1) Why can I not refresh the report in Power BI Service with this script?
2) Are there any workarounds I could use to avoid this?
I'll leave the Python script below in case anybody has any insights. The script works perfectly when executed in Power Query.
Thank you in advance for the help!
import pandas as pd
import re
from datetime import datetime
def extract_and_standardize_date(text):
if pd.isna(text) or text.strip() == '':
return None
date_pattern = r'\b(0?[1-9]|[12][0-9]|3[01])[-/. ](0?[1-9]|1[012]|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)(?:[-/. ](\d{2}|\d{4}))?\b'
match = re.search(date_pattern, text, re.IGNORECASE)
if match:
groups = match.groups()
day = groups[0]
month = groups[1]
year = groups[2] if groups[2] else str(datetime.now().year) # Use current year if year is missing
if month.isalpha():
datetime_object = datetime.strptime(month, "%b")
month = datetime_object.month
if len(year) == 2:
year = '20' + year
return f"{day.zfill(2)}/{str(month).zfill(2)}/{year}"
return None
dataset['standardized_date'] = dataset['Column_X'].apply(extract_and_standardize_date)
dataset
Thanks for the response.
I don't seem to have the ability to create a personal gateway.
Could this be a result of the fact I'm using a dataflow?
You need to do things the other way round. First install and run the personal gateway and then use it in a dataflow.
Python and R scripts and visuals mandate the use of a personal gateway.