Smart Systems for Home

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

Power Query List.AllTrue: Step-by-Step Guide

· 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

List.AllTrue is a Power Query M function that returns true only if every item in a list is true; if any item is false, null, or not a logical value, it returns false. It is the quickest way to validate a whole column of yes/no flags or a set of conditions before you load data into a report. You do not need any add-ins or special setup — just Power Query, which is built into Excel and Power BI Desktop.

What You'll Need

  • Excel (Microsoft 365 or Excel 2019 and later) or Power BI Desktop — Power Query is already included.
  • A table or query with a column that contains logical values (true/false), or a list of conditions you want to test.
  • Basic familiarity with the Power Query Editor: opening it, selecting a query, and adding a custom column.

Menu labels in Power Query can differ slightly by version, device, and region, so if a button name looks different, look for the closest match.

Step-by-Step

  1. Load your data into Power Query. In Excel, select your table and go to Data > From Table/Range. In Power BI Desktop, use Home > Transform data to open the Power Query Editor. If your data is already a query, just open the editor.
  2. Make sure the column you want to test contains logical values. Select the column, then check the data type icon in the column header. If it shows ABC or 123, go to Home > Data Type and choose True/False. If the column contains text like "Yes" and "No", convert it first: right-click the column header > Replace Values, or use Transform > Replace Values to turn "Yes" into true and "No" into false, then set the data type to True/False.
  3. Decide where the result should go. List.AllTrue works on a list, so you need to feed it a list. The most common approach is to add a custom column that evaluates the whole column as a list. Go to Add Column > Custom Column.
  4. Enter the formula. In the Custom Column dialog, name the column (for example, AllApproved) and enter a formula such as:
    List.AllTrue(#"Changed Type"[Approved])
    Replace Changed Type with the actual name of your previous step (visible in the Applied Steps pane on the right) and Approved with your column name. The square brackets refer to the column, and the step name in quotes tells Power Query which table to read it from.
  5. Click OK. Power Query adds the new column. Every row will show the same result — true if every value in the source column is true, otherwise false. That is expected: List.AllTrue checks the entire list, not each row individually.
  6. Check the result. If you expected true but see false, look for false values, blanks, or errors in the source column. A single false or null is enough to make the whole result false.
  7. Use the result where you need it. You can filter the new column to true, reference it in another query, or use it in a conditional column. If you only need a one-off check, you can also run List.AllTrue in the formula bar on a manually built list, for example List.AllTrue({true, true, true}), which returns true.
  8. Apply and close. When you are done, go to Home > Close & Load (Excel) or Home > Close & Apply (Power BI) to load the result.

Common Mistakes

  • Passing a column instead of a list. Writing List.AllTrue([Approved]) without the step name usually causes an error because Power Query does not know which table the column belongs to. Always include the step name, e.g. #"Changed Type"[Approved].
  • Leaving the column as text. Values like "true" stored as text are not logical values. List.AllTrue will return false or an error. Convert the data type to True/False first.
  • Forgetting that null counts as not true. A blank cell in the column makes the result false. If blanks should be ignored, filter them out or replace them with true before testing.
  • Expecting a row-by-row result. List.AllTrue returns one value for the whole list. If you want to test each row separately, use a custom column with a simple comparison like [Approved] = true instead.
  • Using the wrong step name. If you rename or delete a step, the formula breaks. Check the Applied Steps pane for the exact current name.

Tips

  • Use List.AllTrue as a quick data-quality gate: add it as a custom column, then filter to false to find rows that fail your rule.
  • Combine it with List.AnyTrue when you need "at least one" instead of "all". List.AnyTrue returns true if any item is true.
  • If your list can contain nulls and you want to treat them as true, clean the column first with Transform > Replace Values or Table.SelectRows.
  • For a small set of conditions, you can build a list inline: List.AllTrue({[Status] = "Open", [Amount] > 0}) inside a custom column. This evaluates the conditions per row, which is often more useful than testing an entire column.
  • Keep step names descriptive. A step called "Changed Type" is easy to reference; a step called "Custom1" is easy to lose track of.

Troubleshooting

If List.AllTrue returns an error, check the formula first. The most common cause is a missing or misspelled step name. Open the Applied Steps pane, confirm the exact name, and make sure it is wrapped in quotes with a hash symbol: #"Step Name".

If the result is false when you expect true, inspect the source column for false values, blanks, or text that looks like true but is stored as text. Filter the column to show only false or null values, fix them, and refresh the query.

If the function is not recognized, confirm you are using it in the Power Query Editor, not in a regular Excel cell. List.AllTrue is an M function and only works inside Power Query. Also check that you have not typed it as List.Alltrue — M is case-sensitive, so the capital T matters.

If the query is slow on a very large table, remember that List.AllTrue evaluates the entire column. For big datasets, consider filtering to the rows you care about first, or use a simpler row-level test if you do not need an all-or-nothing check.

If you accidentally delete the custom column or the step, use the Applied Steps pane to remove the step and re-add it. Power Query does not have an undo history beyond the steps list, so work from a copy if the query is complex.

Frequently Asked Questions

What does List.AllTrue return if the list is empty?

It returns true. An empty list has no false items, so the condition "all items are true" is satisfied.

Does List.AllTrue treat null as false?

Yes. A null value is not true, so any null in the list makes the result false.

Can I use List.AllTrue on a column without a step name?

No. You need to reference the table step, for example #"Previous Step"[ColumnName], so Power Query knows which table the column comes from.

What is the difference between List.AllTrue and List.AnyTrue?

List.AllTrue requires every item to be true; List.AnyTrue requires at least one item to be true. Both return a single logical value.

Why does my custom column show the same value on every row?

Because List.AllTrue evaluates the whole column as one list. If you want a per-row result, use a row-level comparison such as [Column] = true instead.

Can I use List.AllTrue in Power BI measures?

No. It is a Power Query M function and works during data preparation, not in DAX measures. Use it in the Power Query Editor before loading the model.