High severitydbt
Power BI Refresh Error:
Compilation Error: Invalid ref function
What does this error mean?
A ref() call in a dbt model references a model that does not exist in the project. The model name is misspelled, was renamed, or belongs to a package that is not installed.
Common causes
- 1The model name in the ref() call is misspelled or does not match the .sql filename exactly
- 2The referenced model was renamed or deleted
- 3The model belongs to a dbt package listed in packages.yml that has not been installed via `dbt deps`
How to fix it
- 1Check the spelling of the model name in the ref() call — it must exactly match the .sql filename without the extension.
- 2Run `dbt ls` to see all models that dbt can resolve.
- 3If the model is in a package, ensure the package is listed in packages.yml and run `dbt deps`.
- 4Check for circular dependencies using the lineage graph in dbt Cloud.
Frequently asked questions
Official documentation: https://docs.getdbt.com/guides/debug-errors