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
danmalone89
New Member

Column name is Date, changes on refresh, preventing steps from working

I am importing data via a Web Query from Morningstar.

 

One of the columns is "Total Return % (02/25/2018)" for example. I need to change this column name to "Mutual Fund", but as soon as I refresh the data the next day, the source column name changes to "Total Return % (02/26/2018)" and then my rename step breaks because it's looking for "Total Return % (02/25/2018)" when it's now the next day's date.

 

Can anyone recommend a solution here? I need that column to always be named "Mutual Fund".

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

@danmalone89,

 

You may refer to code below.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI0UIqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [id = _t, #"Total Return % (02/25/2018)" = _t]),
    tmp = List.Combine({List.FindText(Table.ColumnNames(Source), "Total Return %")
                        , {"Mutual Fund"}}),
    result = Table.RenameColumns(Source, tmp) 
in
    result
Community Support Team _ Sam Zha
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

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@danmalone89,

 

You may refer to code below.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI0UIqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [id = _t, #"Total Return % (02/25/2018)" = _t]),
    tmp = List.Combine({List.FindText(Table.ColumnNames(Source), "Total Return %")
                        , {"Mutual Fund"}}),
    result = Table.RenameColumns(Source, tmp) 
in
    result
Community Support Team _ Sam Zha
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.