General
The [Table].FindColumn can be used in Column Numbers property of a Table Element to Find the number of the column according to the header and use it together with the CreateList function.
Syntax
The syntax of the [Table].FindColumn function is:
[Table].FindColumn ("header")
Examples
In a table with 2 columns: Dimension 1 and Measure 1, [Table].FindColumn("Dimension 1") will return 1:
[Table].FindColumn("Dimension 1")
It is possible to use expressions in case the Headers are dynamic:
CreateList ( [Table].FindColumn(“name of column1”) , [Table].FindColumn(“name of column2”), [Table].FindColumn(“YTD Sales ” & Date.Now.Year) )
If one of the columns is not found, an exception will be thrown and the Report will fail. In contrast, when using FindOptionalColumn, the error will be ignored and the table will not contain this column.