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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
PrakashGupta
New Member

CONVERT(VARCHAR(10), Date, 20) is creating issues in direct query option while converting date in a

Hi All,
I am getting an error "This query contains transaformation that cannot be used for a live connection". I am using CONVERT(VARCHAR(10), Date, 20) in my query and using DirectQuery option instead of import.

 

Also if you can add some link how to use query in porwer BI that will be useful.

 

Thanks in advance.

 

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

@PrakashGupta@hugoberry I got the information that DirectQuery works is by taking the user query and putting it into a subselect. In order for this to work, it needs to be able to reference columns in the user query by name. Duplicate names or names that are missing would prevent that from working. So this is effectively by design.

 

In your scenario, please specify a alias for that convert() results in T-SQL query as suggested in my first post.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
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

7 REPLIES 7
v-qiuyu-msft
Community Support
Community Support

@PrakashGupta@hugoberry I got the information that DirectQuery works is by taking the user query and putting it into a subselect. In order for this to work, it needs to be able to reference columns in the user query by name. Duplicate names or names that are missing would prevent that from working. So this is effectively by design.

 

In your scenario, please specify a alias for that convert() results in T-SQL query as suggested in my first post.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-qiuyu-msft
Community Support
Community Support

Hi @PrakashGupta,

 

Based on my tested in desktop version 2.45.4704.442 with DirectQuery mode, the T-SQL query below can works fine.

 

select CONVERT(VARCHAR(10), DateCol, 20) Col1
from [dbo].[DateVal]

 

In your scenario, I guess the issue my not related to Convert() function itself. The error message indicates there might have some action is not supported in DirectQuery mode. Please review the Limitations of DirectQuery . 

 

Would you please share the T-SQL query you used in desktop? Except this query, is there any other queries or transform actions performed in desktop?

 

Best Regards,
Qiuyun Yu

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

As mentioned in my reply, you can replicate the issue if you don't give an alias to CONVERT call

@hugoberry Thanks for your prompt. Smiley Happy

 

@PrakashGupta I already sent a email to consult this issue internally, will update to you if I get any feedback.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hugoberry
Responsive Resident
Responsive Resident

Just tested your query. Indeed you get the problem if you don't specify a name for the column. Give an alias to convert... call either with AS or with [date_converted]=convert ... construct
hugoberry
Responsive Resident
Responsive Resident

Have you tried doing the date conversion in Power Query or data model instead?
Greg_Deckler
Community Champion
Community Champion

When you say in your query, you are referring to SQL, correct?



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.