Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Power Query Value.Alternates: How to Use It

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Value.Alternates is a Power Query M function that takes a list of values and returns a list of the alternate values—that is, every item except the first one. In practice, it is a quick way to drop the first element from a list without knowing its value. You can use it in a custom column, a query step, or inside another function to skip a header row or a leading label. The function is part of the standard M library, so it works in Excel, Power BI, and any other host that runs Power Query. No add-ins or special permissions are needed.

What You'll Need

  • Power Query Editor open in Excel or Power BI Desktop. In Excel, go to Data > Get Data > Launch Power Query Editor. In Power BI Desktop, click Transform data on the Home ribbon.
  • A query that produces a list, or the ability to create one. You can type a list directly in a blank query using the formula bar, or reference an existing column as a list with the drill-down or “Convert to List” option.
  • Basic familiarity with the formula bar and the Advanced Editor. You will type or paste M code, so it helps to know how to open the Advanced Editor (Home > Advanced Editor).

Menu labels can differ slightly by version, device, or region, but the core steps below are the same across current builds.

Step-by-Step

  1. Create or open a query that contains a list. The simplest way to test is to start a blank query: in Power Query Editor, go to Home > New Source > Other Sources > Blank Query. Then open the Advanced Editor and replace the default code with a list literal, for example: let Source = {10, 20, 30, 40} in Source. Click Done. The query now returns a list of four numbers.
  2. Add a step that calls Value.Alternates. With the query selected, open the Advanced Editor again. Add a new line after the Source step: Alternates = Value.Alternates(Source). Then change the final in clause to return Alternates. The full code becomes: let Source = {10, 20, 30, 40}, Alternates = Value.Alternates(Source) in Alternates. Click Done. The preview now shows {20, 30, 40}—the first value is gone.
  3. Use it on a column from a table. If your list comes from a table column, first convert that column to a list. Select the column, right-click the column header, and choose “Drill Down” (or use Transform > Convert to List if available in your version). This produces a list query. Then apply Value.Alternates as in step 2, referencing the list step name instead of Source.
  4. Apply it inside a custom column or another function. You can call Value.Alternates on any list expression. For example, to skip the first item of a list produced by Text.Split, write Value.Alternates(Text.Split("a,b,c", ",")), which returns {"b", "c"}. This is useful when the first element is a header or label you want to ignore.
  5. Handle empty or single-item lists. Value.Alternates returns an empty list if the input list has zero or one item. It does not raise an error. If your downstream steps expect at least one value, add a check such as if List.Count(Source) > 1 then Value.Alternates(Source) else Source to avoid unexpected blanks.
  6. Verify the result. Click the step in the Applied Steps pane and check the preview. For a list of numbers, you should see the first number removed. For a list of records, the first record is removed. If you see an error, confirm that the argument is a list, not a table or a single value.

Common Mistakes

  • Passing a table instead of a list. Value.Alternates expects a list. If you pass a table, you get an error. Convert the table column to a list first, or use Table.Skip for tables.
  • Expecting it to remove duplicates or sort. Value.Alternates only drops the first item. It does not change order or remove repeated values. Use List.Distinct or List.Sort for those tasks.
  • Forgetting that the first item is removed by position, not by value. If your list is unsorted, the “first” item is whatever appears first in the list, not the smallest or earliest. Sort the list first if order matters.
  • Assuming it works on a null or error. If the input list contains nulls, they are kept as items. If the input itself is null, you get an error. Guard with if Source = null then null else Value.Alternates(Source) if needed.
  • Using it where Table.Skip is more appropriate. For table rows, Table.Skip(Table, 1) is clearer and preserves the table structure. Value.Alternates is for lists.

Tips

  • Combine Value.Alternates with List.Transform to process all items except the first: List.Transform(Value.Alternates(MyList), each _ * 2).
  • Use it to strip a header row from a list of column names before unpivoting or renaming.
  • If you need to drop more than one leading item, use List.Skip(MyList, n) instead. Value.Alternates is equivalent to List.Skip(MyList, 1).
  • Remember that the function is case-sensitive: Value.Alternates with a capital V and A. M is case-sensitive for function names.
  • Test with a small list first. A blank query with a list literal is the fastest way to confirm behavior before applying it to a large query.

Troubleshooting

If you get an error saying the argument is not a list, check the step you are referencing. In the Applied Steps pane, click the step and look at the preview: if it shows a table icon, you have a table, not a list. Convert the column to a list or use Table.Skip. If the function returns an empty list unexpectedly, your input list may have only one item or be empty. Check List.Count on the input. If the query fails after adding the step, open the Advanced Editor and confirm the syntax: the function name must be exactly Value.Alternates and the argument must be a list expression, not a text value. If you are unsure, revert the step and rebuild it one line at a time. For version-specific behavior, consult the official Power Query M function reference.

Frequently Asked Questions

What does Value.Alternates actually return?

It returns a list containing all items of the input list except the first one. The order of the remaining items is unchanged.

Can I use Value.Alternates on a table column directly?

No. It requires a list. Convert the column to a list first (for example with Drill Down or Convert to List), then apply the function.

Does Value.Alternates remove the first item by value or by position?

By position. It always drops the item at index 0, regardless of what that value is.

What happens if the list is empty or has one item?

It returns an empty list. It does not error.

Is Value.Alternates the same as List.Skip?

Yes, for a skip count of 1. Value.Alternates(list) is equivalent to List.Skip(list, 1).

Can I use Value.Alternates in Power BI and Excel?

Yes. It is part of the standard M library available in both Power Query in Excel and Power BI Desktop, as well as other hosts that run Power Query.