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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Python while loop in power query version above 3.9.0

Hi everyone I have a case i really can t understand:

my python code in power query uses a while loop as below:

while i < len(XXX):

 

This works fine in python version 3.9.0 but not in 3.9.4 ???

 

Any one had the same issue or better a solution of this issue (apart from  downgradding to 3.9.0)

 

tks in advance

3 REPLIES 3
rohit1991
Super User
Super User

The issue is likely due to differences in the Python environment or library versions. Solutions:

  1. Check Python Path: Ensure Power Query uses the correct Python path in Options > Python Scripting.
  2. Verify Library Behavior: Check for changes in libraries (e.g., Pandas, NumPy) between Python 3.9.0 and 3.9.4.
  3. Debug in Power Query: Test the script directly in Power Query to identify specific compatibility issues.

Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
Akash_Varuna
Super User
Super User

Could you elaborate the error what you are getting 

You replied to 2 years old post 🙂


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.