- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

A cyclic reference was encountered
Hi I'm trying to get a power query to work and each way I try I'm encountering the cyclical reference error.
So I can get this info in DAX but final aim is to have dynamic filters for a matrix - so I need the data to be compiled in query editor first. I want a column created (CSATDue) that checks what survey cycle the account is grouped into "SurveyCycle" versus the current quarter we are in.
My company has financial quarters that are not Jan-March, apr-Jun etc so the previous step works out the company quarter we are currently in: (CurrentCmpyQuarter).
The code I'm trying to use is below - I can't see how this is causing a cyclical error so hoping you can help.
let
Source = #"Client_list",
fnCSATDue = (CurrentCmpyQuarter as text, SurveyCycle as text) as text =>
if SurveyCycle = null then "No SurveyCycle"
else if ( CurrentCmpyQuarter = "Qtr4" or CurrentCmpyQuarter = "Qtr2") and SurveyCycle = "Q2/Q4" then "Yes"
else if ( CurrentCmpyQuarter = "Qtr1" or CurrentCmpyQuarter = "Qtr3") and SurveyCycle = "Q1/Q3" then "Yes"
else "No",
AddedCustom = Table.AddColumn(Source, "CSATDue", each fnCSATDue([CurrentCmpyQuarter], [SurveyCycle]))
in
AddedCustom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

hi, @P0ach3r1 first, use SurveyCycle as nullable text.Otherwise your function won't accept nulls. Other than this I don't see any problems with your function. How about Source = #"Client_list"? Does it feel good?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi - #"Client_list"? Does it feel good?
Client_list is the name of the table so I assume so?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@P0ach3r1 your code works just fine. I believe that either smth is wrong with Client_list or bad things happen outside of your code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thanks for taking the time to support. I was trying this last night in another table and got the same error. I then did a join to pull survey cycle across to Client_list table. Both times the query to calculate the current company quarter worked fine but the query for CSATDue fails. I also combined both queries to see if that resolved it (so calculated current quarter then did the lookup vs other columns) but got the same cyclical error. Maybe I need to rebuild client list.

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
04-06-2022 07:28 AM | |||
03-14-2022 06:02 AM | |||
Anonymous
| 08-11-2022 06:02 AM | ||
Anonymous
| 05-21-2024 11:06 AM | ||
09-20-2018 02:46 AM |
User | Count |
---|---|
27 | |
25 | |
25 | |
13 | |
9 |
User | Count |
---|---|
24 | |
19 | |
16 | |
13 | |
9 |