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
Anonymous
Not applicable

Column names with reserved keywords not being identified properly while importing data in PowerBI

While importing data I'm using MS SQL Server query. Few columns in the data have reserved key words in them for eg. [Opportunity Close Date]. Such columns can be addressed properly in SQL server by putting them in square brackets but PowerBI keeps throwing error, "Invalid Coumn name 'Opportunity Close Date'". I have tried writing such column names:

1) Using square brackets

2) In double quotes

3) In single quotes

4) Casting them as nvarchar()

5) Using table.column_name convention

6) Combination of 1 and 5

 

But still no luck 😞

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi Nash_s,

Yes, when refer to field, you could use [#"Opportunity Close Date"] to see whether it work or not

471.PNG

In addition, you need to make sure there is no space at the end of column name, you could see my above image, there is a space at the end of [amount], so I need to use [#“amount ”].

By the way, did you refer to last steps's result? If so, you need to use last steps name instead of column name(you could see the #"Added custom" row)

Best Regards,
Zoe Zhi

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

4 REPLIES 4
dax
Community Support
Community Support

Hi Nash_s,

Yes, when refer to field, you could use [#"Opportunity Close Date"] to see whether it work or not

471.PNG

In addition, you need to make sure there is no space at the end of column name, you could see my above image, there is a space at the end of [amount], so I need to use [#“amount ”].

By the way, did you refer to last steps's result? If so, you need to use last steps name instead of column name(you could see the #"Added custom" row)

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

I realized that there was space at the end of the field name that made PowerBI to not identify it properly. Thanks for the help. Appreciate it 🙂

@dax 

Anonymous
Not applicable

Hi @Anonymous ,

 

Try [#"Opportunity Close Date"]. It should work PQ.

Just had a second thought: you have a problem naming them in PQ, not transferring names to PBI?

 

Kind regards,

John

Anonymous
Not applicable

Thanks for the response. I realized there was a space after the field name that made PowerBI to not identify the field properly.

@Anonymous 

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.

Top Solution Authors