Reply
Regular Visitor
Posts: 28
Registered: ‎07-20-2017
Accepted Solution

JSON and Direct Query

Hi PBI Community, 

I need some assistance, I am trying to parse JSON out of a column. The current connection type is Direct query to an SQL server. Unfortunatly because of this connection type i cannot use the "transform function" in the query editor to quickly parse out the JSON. 

What options do i have while still remaining connected via direct query? 

 

 

Data looks like
 JSON.PNG


Accepted Solutions
Moderator
Posts: 9,894
Registered: ‎03-10-2016

Re: JSON and Direct Query

@BenActionKPI,

Instead of parsing JSON in Power BI Desktop, using SQL statement to combine relational rows and JSON elements with CROSS APPLY and OPENJSON() functions during the import process, then import all the data.

For moredetails about query JSON data using T-SQL, please review the following articles.

https://docs.microsoft.com/en-us/sql/t-sql/functions/openjson-transact-sql
https://sqlwithmanoj.com/2015/11/02/store-json-data-in-a-table-openjson-and-json_value-functions-sql...


Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post


All Replies
Moderator
Posts: 9,894
Registered: ‎03-10-2016

Re: JSON and Direct Query

@BenActionKPI,

Instead of parsing JSON in Power BI Desktop, using SQL statement to combine relational rows and JSON elements with CROSS APPLY and OPENJSON() functions during the import process, then import all the data.

For moredetails about query JSON data using T-SQL, please review the following articles.

https://docs.microsoft.com/en-us/sql/t-sql/functions/openjson-transact-sql
https://sqlwithmanoj.com/2015/11/02/store-json-data-in-a-table-openjson-and-json_value-functions-sql...


Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Regular Visitor
Posts: 28
Registered: ‎07-20-2017

Re: JSON and Direct Query

To clarify the direction I took for any readers of this in the future, I ended up switching the data connection type to import in order to gain full power query and dax functionality which will enable me to use "Path" and "Pathitem". 

Cheers