Forum Discussion
Edit and preserve column headers in connected table
- 1 year ago
You need to distinguish between two scenarios
#1 Run a DAX query against a semantic model. For that you connect to "Power BI Semantic Model". You won't be able to change/remove the table names
#2 Import data from a SSAS cube ("Analysis Services Database"), by specifying the same DAX query. This will result in a Power Query connection where you can then add steps to remove the table names and do other manipulations.
I tried the solution from the post I referred to.
Then I am able to remove the table name and the square brackets from the column name:
This is achievable using the M statement you provided:
let
Source = Excel.CurrentWorkbook(){[Name="Table_ExternalData_1"]}[Content],
Res = Table.TransformColumnNames(Source,each if Text.End(_,1)= "]" then let p=Text.PositionOf(_,"[") in Text.Range(_,p+1,Text.Length(_)-p-2) else _ )
in
Res
But for this to work, It needs to reference the table in the current workbook.
So, If I want to make this file refreshable, I need to keep both tables in the file, to be able to reference it in power query?
not sure what "both tables" means here. It's a single query that has transforms applied to it. Please elaborate.