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
Ry5
Helper I
Helper I

Format a field to Title Case when using Direct Query

Hello,
I need to set a field to Title Case, which is easily done in Transform Data > Transform Tab > Format > Capitalise Each Word
However I'm getting an error that this can't be done with Direct Query. I can't change this data to Import, it has to be Direct Query. Is there an alternative way in DAX (or however else) to set the field to Title Case?
Thank you

 
1 ACCEPTED SOLUTION

Hi @Ry5 ,

 

No, Direct Query mode does not support this complex query foldring. The only way to solve the problem is from your database side

 

The power bi get data form SQL Database is using query foldring to change the query to sql statement and send it to SQLDB, then SQLDB return the data to power bi. 

Query foldring only support simple transform data like sum(), rename().This is for better performance performance and unnecessary errors. For more details you can refer these links.

Query folding - Power Query | Microsoft Docs

Using DirectQuery in Power BI - Power BI | Microsoft Docs

 

Best Regards

Community Support Team _ chenwu zhu

 

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

4 REPLIES 4
Ry5
Helper I
Helper I

Thank you
I did find a conversion process here - 

https://stackoverflow.com/questions/63652947/convert-to-proper-case-using-dax
It's an overcomplicated solution but it's there if anyone is unable to set the formatting back in their source data.

pavanmarri
Regular Visitor

In the datasource connection --> Advance options --> Specify the Select query. 

Example : select upper(colname) Col1, lower(colname) Col2 from table1.

 

pavanmarri_0-1652164820947.png

 

This returns two columns - one with the field in all uppercase, the second with the field in all lowercase
I need the field to be in Title Case, where every word has a capital first letter and the remaining are all lowercase

Hi @Ry5 ,

 

No, Direct Query mode does not support this complex query foldring. The only way to solve the problem is from your database side

 

The power bi get data form SQL Database is using query foldring to change the query to sql statement and send it to SQLDB, then SQLDB return the data to power bi. 

Query foldring only support simple transform data like sum(), rename().This is for better performance performance and unnecessary errors. For more details you can refer these links.

Query folding - Power Query | Microsoft Docs

Using DirectQuery in Power BI - Power BI | Microsoft Docs

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors