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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
dvp
Helper I
Helper I

Azure Data Explorer / Kusto with dynamic column

I have the following function in ADX/Kusto:

 

.create-or-alter function with (docstring = "Customers View",folder = "Views") CustomersTest {
    datatable (CustomerId:string, StateReasons:dynamic) [
        "ee1eaead-5f6d-4371-80cb-7881679f8116", dynamic(["Reason1""Reason2"]) ]
    | extend StateReasons[0], StateReasons[1]
}
 
When I try to display e.g. CustomerId and StateReasons (or StateReasons_0, StateReasons_1) using DirectQuery in Power BI Desktop I get the following cryptic error:
 

Release:
December 2020

Product Version:
2.88.1385.0 (20.12) (x64)

Error Message:
OLE DB or ODBC error: [Bad request] Request is invalid and cannot be executed..

 

Any clue how to resolve this one?

1 ACCEPTED SOLUTION
dvp
Helper I
Helper I

There seem to be 2 solutions to the issue:

 

1) Replace

 

 | extend StateReasons[0], StateReasons[1]

 

with 

 

 | extend tostring(StateReasons[0]), tostring(StateReasons[1])

 

in the function

 

2) Add a Data Transformation step in Power BI Desktop and set the data type of the 2 columns to Text ...

View solution in original post

2 REPLIES 2
dvp
Helper I
Helper I

There seem to be 2 solutions to the issue:

 

1) Replace

 

 | extend StateReasons[0], StateReasons[1]

 

with 

 

 | extend tostring(StateReasons[0]), tostring(StateReasons[1])

 

in the function

 

2) Add a Data Transformation step in Power BI Desktop and set the data type of the 2 columns to Text ...

v-easonf-msft
Community Support
Community Support

Hi , @dvp 

Sorry I can't fix it on my side,it is recommended to open a support ticket to let engineers look into the issue on your side.

Support Ticket.gif

 

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.