How would I accomplish this:
I'd like to rename my columns either on import or immediately following.
Example name that comes in: [DIM A].[YEAR].[YEAR].[MEMBER_CAPTION]
Name I want to display: Year
@mike_honey - would love to see this demo file. I checked, but perhaps it's no longer in the OneDrive location? Any way for me to access it?
hi - completely new to M so please bear with me
If I enter the below as a column I =in the PBI Query editor, I get "Expression.Error: The name 'table' wasn't recognized. Make sure it's spelled correctly."
= Table.TransformColumnNames(table, (columnName as text) as text => Text.Replace(columnName, "_", ""))
So I presumbed that I was to replace table with my table name and entered the below and I get "Expression.Error: A cyclic reference was encountered during evaluation."
= Table.TransformColumnNames(#"Project Cache", (columnName as text) as text => Text.Replace(columnName, "_", ""))
I just need to get past the first hurdle!
Also can Table.TransformColumnNames add spaces before capitals?, e.g. transform "EstDurationAtCompletion" into "Est Duration At Completion"
You are so close - you just need to replace "table" with the previous STEP name (not table/query name). If that step name has spaces or special characters it will need to be enclosed e.g. #"My Previous Step Name".
It's a weird feature of the M language. It's not what I'd call a "script" language where the sequence of the lines of code controls the flow. In the code generated by the Power Query UI, there's actually a reference to the prior line of code, on every line. Technically that returns a table with all the data "as at" that prior step.
We're excited to announce our first cross-community 'Can You Solve These?' challenge!
Visit our Community Blog for articles, guides, and information created by fellow community members.
Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.