This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA 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.
Hello all,
Iám trying to implement machine learning in power BI , While trying to run the python code at edit queries level , the below given error is being thrown , can anyone guide me with a possible solution :
Python code :
from pycaret.clustering import *
dataset = get_clusters(data = dataset)
Error generated:
DataSource.Error: ADO.NET: Python script error.
Traceback (most recent call last):
File "PythonScriptWrapper.PY", line 2, in <module>
import os, pandas, matplotlib
File "C:\Users\subhashreer\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\__init__.py", line 55, in <module>
from pandas.core.api import (
File "C:\Users\subhashreer\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\core\api.py", line 29, in <module>
from pandas.core.groupby import Grouper, NamedAgg
File "C:\Users\subhashreer\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\core\groupby\__init__.py", line 1, in <module>
from pandas.core.groupby.generic import DataFrameGroupBy, NamedAgg, SeriesGroupBy
Hi. This might sound a stupid question but, is this code working outsite Power Bi? As far as I remember you have to specify the number of clusters.
I have found these articles. I hope they can help you:
https://towardsdatascience.com/how-to-implement-clustering-in-power-bi-using-pycaret-4b5e34b1405b
https://prog.world/how-to-implement-clustering-in-power-bi-using-pycaret/
Regards,
Happy to help!
Hello @Anonymous,
The cluster number need not be specified because in the standard function, the cluster number is taken as four. There is a problem somewhere else.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 28 | |
| 27 | |
| 24 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 49 | |
| 47 | |
| 40 | |
| 21 | |
| 19 |