Power QueryExercises

Expression.Error: A cyclic reference was encountered during evaluation

By Tahir Nas · Examples run in our simulator · Updated

Expression.Error: A cyclic reference was encountered during evaluation.

Two steps or queries depend on each other, directly or through a chain, so neither can be computed first.

Common causes

How to fix it

  1. Make each step refer only to steps above it.
  2. Break query loops: move shared logic into a third query both can reference.
  3. Use Query Dependencies (View tab) to see the loop.

Find the step that fails

Minimal example

Raises the error:

let Total = Net + 1, Net = Total - 1 in Total

Fixed:

let Net = 10, Total = Net + 1 in Total

Both snippets are run by the Power Query Exercises simulator on every build: the first must raise Expression.Error, the second must run.

Practise avoiding it

Related lessons

Similar errors