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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SanthuWilly4
Frequent Visitor

SQL Query in Direct Query Mode in Power BI

Hi , 

 

I'm trying to build a dynamic report using Direct Query connection connecting to SQL Server , I can able to connect to direct tables and from there I'm able to create visuals where the data is updating dynamically for every 30 seconds.

 

Here's my road block , most of the tables has to be transformed in data wise

For Example :

1. Few tables has delimited values in a single column and I need to split them into separate columns

2. Few tables has XML Column with XML content and I need to convert that XML content into individual columns 

 

But When I'm inserting SQL Query (by transforming all the columns and content) in Advance Section selecting Direct Query , it is throwing Syntax error ")" 

 

Please help , if I overcome this mostly I will be get going in creating the visuals.

 

Thank you 

Santosh Reddy

4 REPLIES 4
Greg_Deckler
Super User
Super User

@SanthuWilly4 - Going to be difficult with Direct Query doing that in Power Query. Probably have to do it in DAX and create columns pushing you into composite mode. Can you be specific with a use case? Alternatively use import mode. As a last resort maybe you can do certain things completely within measures. 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi Greg , Thanks for your reply.

 

Here's my sittuation I want to split SSRS report path /Folder1/Folder2/Folder3/Folder4/ReportName into it's individual columns.

I able to do this in Import Mode by Column Split By Delimeter but this is feature is not supported in Direct Query mode.

Also I have tried DAX function PATHITEM (which does almost same) then I came to know that most of the DAX functions are not available in Direct Query mode 😞

 

 

Regards,

Santosh Reddy

@SanthuWilly4  Have you checked the box to allow unrestricted measures via DirectQuery and that I believe should allow to use most of the functions.

directquery.PNG


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@SanthuWilly4 , Transformation in direct query mode is limited to a certain set of operations. So need to check what is possible what is not. I do not think complex transformation on XML is there.

 

There are a few basics operations I tested out that work. But I doubt what you need is.

What I tested on direct query -https://www.youtube.com/watch?v=My0bLn9voo4&list=PLPaNVDMhUXGbKatyDdOhGbTL3xW2Xy6pA

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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