Forum Discussion
vinoqueries
Oct 27, 2021Copper Contributor
Lettered Index in Power Query
Heyo Is there anyway to simplify this code? Maybe using List.Generate? I'm trying to take a table and add a lettered index A-Z as opposed to numbered. I couldn't find any web posts on the idea so...
Riny_van_Eekelen
Oct 27, 2021Platinum Contributor
vinoqueries Not really sure why you would want to create an A to Z index, as you limit yourself to 26 rows. But, I take it that you have a good reason for doing so. To simplify your code, you could try this. After adding the regular index column from 1 to max 26, add the AlfaIndex column using:
= Table.AddColumn(#"Added Index", "AlfaIndex", each Character.FromNumber ([Index]+64))
Alternatively, create a static table in Excel. One column with a number, another with a letter and merge your indexes data table with the static one.