The List.Range function, extracting values from specified rows in a column
Using the List.Range function, you can get specified values from some column.
For example in this table, you may need three animals, starting from the second animal:
The function is:
- = List.Range(
Source[Animal],
1,
3)
Because:
- = List.Range(
Source[Animal], – name of previous step and name of column with values we need
1, – where to start. Attention, Power Query counts from zero. So Hamster is 0, Guinea pig is 1, etc. So number 1 means we are starting from the second item.
3) – we need 3 animals
After extraction we have this:
It can be used for running totals, getting values from previous rows etc.