Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Visual field binding is lost after renaming columns in Query Mode

Hi All, 

 

It seems that there is bug in Power BI Desktop related to Visual field binding after renaming columns in Query Mode. 

For instance, 

 

There is possibility to define renaming within Query Mode. Everything worked correctly until I have implemented predefined list of renaming. Let me provide the details:

1) Renaming by not-predefined list:

let
Source = ... 
pbi_vDimFlexSlot = Source

{[Schema="pbi",Item="vDimFlexSlot"]}[Data],
#"Filtered Rows" = Table.SelectRows(pbi_vDimFlexSlot, each [CSK] = ClientParametr or [CSK] = -1),
#"Renamed Columns" = Table.RenameColumns(#"Filtered Rows", {{"FlexSlotUDBK1", "L1"}, {"FlexSlotUDBK2", "L2"}, 
{"FlexSlotUDBK3", "L3"}, {"FlexSlotUDBK4", "L4"}, {"FlexSlotUDBK5", "L5"}, {"FlexSlotUDBK6", "L6"}, 
{"FlexSlotUDBK7", "L7"}, {"FlexSlotUDBK8", "L8"}, {"FlexSlotUDBK9", "L9"}, {"FlexSlotUDBK10", "L10"}})
in
#"Renamed Columns"

Model layer is correct after renaming: 

model layer v1

 

Visual layer is also correct after renaming:

Visual layer v1

 

2) Renaming by predefined list (different approaches were tried):

let
Source = ...
pbi_vDimFlexSlot = Source{[Schema="pbi",Item="vDimFlexSlot"]}

[Data],
#"Filtered Rows" = Table.SelectRows(pbi_vDimFlexSlot, each [CSK] = ClientParametr or [CSK] = -1),

pbi_vClientNamingPreference = Source

{[Schema="pbi",Item="vClientNamingPreference"]}

[Data],
#"Preference Filtered Rows" = Table.SelectRows(pbi_vClientNamingPreference, each ([CSK] = ClientParametr) and ([View] = "vDimFlexSlot")),
#"Preference Removed Columns" = Table.RemoveColumns(#"Preference Filtered Rows",

{"View", "CSK"}

), 
rename_list = Table.ToColumns(Table.Transpose(#"Preference Removed Columns")), 
#"Renamed Columns" = Table.RenameColumns(#"Filtered Rows", rename_list)

in
#"Renamed Columns"

 

Model layer is correct after renaming: 

Model layer v2

 

Visual layer is not correct after renaming, binding is lost:

visual layer v2 broken visual

 

Thus, it seems as Power BI Desktop bug.

 

Status: Needs Info
Comments
v-jiascu-msft
Microsoft Employee

Hi @Anonymous,

 

Please update the snapshots. They are corrupted. Can you share a sample file please? Seems good in my side.

 

Best Regards,

Dale

Vicky_Song
Impactful Individual
Status changed to: Needs Info