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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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