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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
deanbland
Helper III
Helper III

How to unpivot columns while referencing the other columns by index

Hi, 

 

My dataset containg columns with headers that are changing dates. When unpivoting one column, the formula looks like this

 

= Table.UnpivotOtherColumns(#"Removed Columns1", {"RESOURCE NAME", "ROLE", "FUNCTION", "PROJECT", "01/01/2022", "01/02/2022", "01/03/2022", "01/04/2022", "01/05/2022", "01/06/2022", "01/07/2021", "01/08/2021", "01/09/2021", "01/10/2021", "01/11/2021", "01/12/2021"}, "Attribute", "Value")

 

I am wanting every column with a date header within the formula to be referenced by its position within the table. So, lets say "01/01/2022" is the 4th in the table, I want to reference it by that position - i.e.,

 

= Table.UnpivotOtherColumns(#"Removed Columns1", {"RESOURCE NAME", "ROLE", "FUNCTION", "PROJECT", "{4}", "{5}", "{6}", "{7}", "{8}", "{9}", "{10}", "{11}", "{12}", "{13}", "{14}", "{16}"}, "Attribute", "Value")

 

If i didn't make sense, please let me know!

 

Thanks in advance!

 

 

1 REPLY 1
v-luwang-msft
Community Support
Community Support

Hi @deanbland ,

Could you pls share your pbix file and the final results of the data displayed.Remember to remove confidential data.

 

Best Regards

Lucien

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.