8. Adding Columns: Power Query Add Column Tab and DAX Calculated Columns
8.6 Index Column
Add Column › Index Column › From 0 / From 1 / Custom… (Custom lets you choose the Starting index and Increment, e.g. start 1001, step 1).
| Use | Example |
|---|---|
| Row number for tracing | Row 57 of the Pune file has a bad date |
| Surrogate key | Create a Store Key for a store list that has no ID |
| Previous-row comparisons | Add Index From 0 and From 1, then merge the table with itself to compare each order with the previous order of the same rider |
| Sort order | Keep the original order of a festival list |
Ravindra Bagale's Tip
Mitrano, dhyan dya: an index added after sorting or filtering changes whenever the data changes, so don't use it as a permanent key. Add the index where the order is meaningful. Lakshat theva, adding an index usually stops query folding, so put it as late as possible. Punha ekda karun bagha, mag pudhe jaa.