Addressing rows, columns and values in Power BI
This is about referencing of values from rows and columns in Power BI or Power Query. It is very simple in Excel sheet, but little bit more challenging in queries (M language).
Let´s play with this table:
Column reference
To get some column, for example Revenule, just write this:
- = MyTable[Revenue]
Row reference
To get n-th (for example third) row from table, write this:
- = MyTable{2}
The result row is converted to column.
Specific value from column
To get the third value from Revenue, column, write this:
- = MyTable{2}[Revenue]
or this:
- =MyTable[Revenue]{2}
It´s tricky – number 2 provides the third value. It is because the rows are indexed from zero – not from one.
What does “mytable” refer to and then you change to Table, but neither refer to the table names which are Table1 and Table2.