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
Nie
Helper I
Helper I

Reference Column Number with Measures

I have a table with 10 columns. The first 5 have fixed column names. The last 5 have column names that I would like renamable by a layman according to needs. These last 5 columns are also ones that I need to write measures for with DAX.

 

Is it possible to reference the columns by their number instead of their name? For example, first column might be Table[0], second column might be Table[1] ... etc.

 

I am thinking if referencing by number is possible, I can store this in a variable and then reference the column dynamically when writing my measures.

 

Or if there is a better way, please let me know, I only have very basic DAX knowledge.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

 

No, it's not possible to have dynamic columns and/or DAX. Column names must be known at the time of data load and can't be changed afterwards dynamically by the user. Also, in DAX there is no concept of column order and indexing into them with a number.

 

And I'm afraid what you'd like to pull off is not possible in DAX at all 😞

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

 

No, it's not possible to have dynamic columns and/or DAX. Column names must be known at the time of data load and can't be changed afterwards dynamically by the user. Also, in DAX there is no concept of column order and indexing into them with a number.

 

And I'm afraid what you'd like to pull off is not possible in DAX at all 😞

Thank you. Appreciate the information.

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