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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.