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
mpk
Frequent Visitor

Changing column header for report build on a snowflake view , using direct query

Hi All, 

 

I am connecting snowflke view to create a report. I have almost 100 + column with header name like "TEXT_TEXT1" . I need to change header to proper case and removing _ to " Text Text1" column headers. Us there any quick way to do this using functions. 

I am trying to use functions but no luck as this is a view not a table. 

Can I do this using direct query connection or have to use "import " connection ? Please help 

 

mpk_0-1596553663001.png

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@mpk 

You can simply do it in Power Query in 2 steps:

Fowmy_0-1596560948529.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("NY3JDQAxCAN74Z1HAuFILVH6b2MxaD8ja4TNvSRGg3Yk9CRM6I20DrsSayeirUtmRyEKUZZhZWIBia2sVQ92w+psW5P8j4f3guIC4NMv3/sA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [TEXT_TEXT1 = _t, TEXT_TEXT2 = _t, TEXT_TEXT3 = _t, TEXT_TEXT4 = _t]),
    Replace_ = Table.TransformColumnNames(Source, each Text.Replace(_, "_", " ")),
    PropperCase = Table.TransformColumnNames(Replace_, each Text.Proper(_))
in
    PropperCase

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@mpk 

You can simply do it in Power Query in 2 steps:

Fowmy_0-1596560948529.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("NY3JDQAxCAN74Z1HAuFILVH6b2MxaD8ja4TNvSRGg3Yk9CRM6I20DrsSayeirUtmRyEKUZZhZWIBia2sVQ92w+psW5P8j4f3guIC4NMv3/sA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [TEXT_TEXT1 = _t, TEXT_TEXT2 = _t, TEXT_TEXT3 = _t, TEXT_TEXT4 = _t]),
    Replace_ = Table.TransformColumnNames(Source, each Text.Replace(_, "_", " ")),
    PropperCase = Table.TransformColumnNames(Replace_, each Text.Proper(_))
in
    PropperCase

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

mpk
Frequent Visitor

thank you 🙂

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
Top Kudoed Authors