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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

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
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.