Forum Discussion
Publishing a User Data Function is giving error
- 1 year ago
In this scenario i suggest you to raise a support ticket here. so, that they can assit you in addressing the issue you are facing. please follow below link on how to raise a support ticket:
How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn
Thanks,
Prashanth Are
MS Fabric community support
Just curious that why do we need User Data Function in Fabric SQL Database?? Use Kimball methodology/ Dimensional Modelling wherever we can. ( DimTable <--> Fact Table )
I am trying to implement write back in a Power Bi report, so as per the newly introduced translytical workflows tutorial it asked to create a UDF that takes values from report as parameters and updates them in the Fabric SQL Database.
- BhaveshPatel1 year agoSuper User
This write back functionlity in Power BI is not available in User Defined Functions. You should do (write back functionilty) this in DWH aka Data Lakehouse. ( in Apache Spark with Python and INSERT ) . I will give you an example:
Writing data back to Azure SQL Database
# Create DataFrame to insert into the Azure SQL table ( Writing Data to Azure SQL Table )#df1 = spark.createDataFrame([('WL2456', 'Luke1293', 'Skywalker','Null','Null',-3,'Unknown','Unknown','Null')], ['DeviceID', 'DeviceName', 'DeviceDesc','OperatorName','OperatorDesc','FacilityID','FacilityName','FacilityDesc','DeviceSerialNo'])# Insert the rows into the Azure SQL tabledf1.write \.option('user', user) \.option('password', pswd) \.jdbc('jdbc:sqlserver://' + sqlserver + ':' + port + ';database=' + database, 'dbo.Devices', mode = 'append' )df1.show()