1

I have a requirement where the name of the column in the report changes dynamically and I am trying to rename it in the advanced editor in PowerBI.

Renamed Columns" = Table.RenameColumns(#"Added Conditional Column1",{{"AgingReport_201801022101.txt", "Report Name"}, {"1/3/2018 2:38:13 AM", "Report Created Time"}})

Here, AgingReport_201801022101.txt could change to AgingReport_12321321321.txton next refresh and similarly this 1/3/2018 2:38:13 AM is subjectible to change as well on further refresh.

Because this changes, my calculated column in PowerBI doesn't recognize the column names on further refreshes.

1 Answer 1

2

You forgot to mention some required information, but assuming you have 1 column starting with "AgingReport" and assuming you have 1 column with a name that would convert to a date/time value and assuming that can be done with your current culture, then you can use the following code:

#"Renamed Columns" = Table.TransformColumnNames(#"Added Conditional Column1", each if Text.StartsWith(_,"AgingReport") then "Report Name" else if Value.FromText(_) is datetime then "Report Created Time" else _)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.