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
Veles
Advocate V
Advocate V

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.

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.