Power Query - get value of a column where the column is an occurence in a list of column names

RobertD 21 Reputation points
2022-05-29T06:06:11.217+00:00

Situation is I have defines a list of columns names (LISTCOLUMNS), e.g. Name0, Name1, Name2, Name3, Name4.
For any given row, I know which column name I need and have established the index 1 through 4.
For example,
Row 1 has Index 3 and therefore needs to get the value of Name3,
Row 2 has index 1 and therefore needs to get the value of Name 1.

This formula
= Table.AddColumn(#"Added Custom2", "Custom1", each [ListColumns]{0}) will retrieve the column text "Name0" but not the value for the value of Name0 in that row.

How can I achieve this?

Community Center | Not monitored
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2022-05-29T12:10:14.463+00:00

    Power query is not currently supported here on Q&A. The product group for Power Query actively monitors questions over at
    https://community.powerbi.com/t5/Power-Query/bd-p/power-bi-services

    --please don't forget to Accept as answer if the reply is helpful--

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.