cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Veles
Advocate IV
Advocate IV

Should you always fully qualify column references?

Hi,

 

Found it difficult to find an answer on this one.

 

While using Power BI I notice that when making a DAX formula, if you use the little helper box it will always fully qualify your column references, even when you're referring to a column in the same table.

 

I've also noticed that Power Pivot doesn't do this.

 

Is there any particular reason why I should or shouldn't fully qualify a column reference where you're referring to a column in the same table?

 

Thanks

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @Veles,

 

You can see from this article:

 

This is known as a fully qualified column name in that it includes the column name preceded by the table name. Columns referenced in the same table do not require the table name be included in the formula. This can make long formulas that reference many columns shorter and easier to read. However, it's good practice to  include the table name in your measure formulas, even when in the same table. > Note: If a table name contains spaces, reserved keywords, or disallowed characters, you’ll need to  enclose the table name in single quotation marks. You’ll also need to enclose table names in quotation marks if the name contains any characters outside the ANSI alphanumeric character range, regardless of whether your locale supports the character set or not.

 

Also you can go through this article to see a fully qualified name is always required when you reference a column in the following contexts:

  • As an argument to the function, VALUES

  • As an argument to the functions, ALL or ALLEXCEPT

  • In a filter argument for the functions, CALCULATE or CALCULATETABLE

  • As an argument to the function, RELATEDTABLE

  • As an argument to any time intelligence function

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
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

1 REPLY 1
v-qiuyu-msft
Community Support
Community Support

Hi @Veles,

 

You can see from this article:

 

This is known as a fully qualified column name in that it includes the column name preceded by the table name. Columns referenced in the same table do not require the table name be included in the formula. This can make long formulas that reference many columns shorter and easier to read. However, it's good practice to  include the table name in your measure formulas, even when in the same table. > Note: If a table name contains spaces, reserved keywords, or disallowed characters, you’ll need to  enclose the table name in single quotation marks. You’ll also need to enclose table names in quotation marks if the name contains any characters outside the ANSI alphanumeric character range, regardless of whether your locale supports the character set or not.

 

Also you can go through this article to see a fully qualified name is always required when you reference a column in the following contexts:

  • As an argument to the function, VALUES

  • As an argument to the functions, ALL or ALLEXCEPT

  • In a filter argument for the functions, CALCULATE or CALCULATETABLE

  • As an argument to the function, RELATEDTABLE

  • As an argument to any time intelligence function

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!