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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Need help on Streaming Dataset

Hi All,

I'm creating Streaming datasets using python. I've created streaming dataset to stream one value which is working fine. But when I tried stream multiple values in line chart it's not working. Please help me on this.

Source is - MemSQL

 

import requests
from datetime import datetime
import time
import psutil
import simplejson as json
import pymysql
import pandas as pd
from pathlib import Path
import schedule


directory =str(Path.home())

connection = pymysql.connect(user="******",
passwd="******",
host="*******",
port=****,
database="******"
)

cur = connection.cursor()

def my_func():
cur.execute("select revenue,order,hour,minute from sample_table")
ls = []
for l in cur.fetchall():
dict_qs = {}
dict_qs['revenue'] = l[0]
dict_qs['order'] = l[1]
dict_qs['hour'] = l[2]
dict_qs['minute'] = l[3]

ls.append(l)
print(dict_qs)
json_data = [{
"Revenue": dict_qs['revenue']
"Order":dict_qs['order']
"Hour":dict_qs['hour']
"Minute":dict_qs['minute']
}]
res = requests.post('Power BI Streaming API', data=json.dumps(json_data))
print(res.status_code)

schedule.every(10).seconds.do(my_func)

while True:
schedule.run_pending()
time.sleep(5)

 

Thanks in Advance

 

 

3 REPLIES 3
v-chenwuz-msft
Community Support
Community Support

Hi @Anonymous ,

 

Did you miss some commas in the json_data list?

vchenwuzmsft_0-1658992239432.png

 

Best Regards

Community Support Team _ chenwu zhu

 

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

Anonymous
Not applicable

No commas are there. I forgot to add it here. but still it's not working

Hi @Anonymous ,

 

Please check the type of dict_qs['hour'], is it int and match the type you definded in power bi. If not, please change it via int().

 

Best Regards

Community Support Team _ chenwu zhu

 

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

 

 

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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