Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
BenJCross95
Frequent Visitor

Cyclic dependency detected while attempting query folding - SQL.

Hi all,

 

I'm attempting to convert a query from an SQL databse into a foldable query in order to use incremental refresh more efficiently. I am trying to use the Value.NativeQuery() function. When applying the steps i'm met with the following message.

BenJCross95_0-1661332856591.png

My Advanced editor output. Apologies if SQL isn't the most efficient, i'm learning as i progress.

BenJCross95_1-1661333434304.png

 

When using my RangeStart and RangeEnd parameters this is giving me the native query of

select [_].[Round],
[_].[Carrier],
[_].[DateTime],
[_].[PartID],
[_].[QtyMissed],
[_].[Description]
from
(
select
Round,
Carrier,
DateTime,
PartID,
QtyMissed,
Description
from
(
select
MissedCarrierID,
Round,
Carrier,
DateTime,
MissedCarrierReasonID,
PartID,
QtyMissed
from
MissedCarriers
) a
left join (
select
MissedCarrierID,
Description
from
MissedCarrierReasons
) b on a.MissedCarrierReasonID = b.MissedCarrierID
) as [_]
where [_].[DateTime] >= convert(datetime2, '2022-01-01 00:00:00') and [_].[DateTime] <= convert(datetime2, '2022-02-01 00:00:00')

 

So it looks like it behaving as i would like it to until i click apply. Has anybody else experienced this? Any help would be greatly appreciated. I've tried on a few different quieries but all doing the same thing. I was hoping for a way to do this without needing a view already joining the two tables.

 

Thanks in advance for any advice.

1 REPLY 1
v-chenwuz-msft
Community Support
Community Support

Hi @BenJCross95 ,

 

Does the problem occur when using your sql statement query alone?

Is there a relationship between this table with other tables?

 

Best Regards

Community Support Team _ chenwu zhu

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors