web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Do until is not stoppi...
Power Automate
Answered

Do until is not stopping after the variable met the condition of loop termination

(0) ShareShare
ReportReport
Posted on by 18

I was doing automation for exporting a table for 10 stores and save as a csv file from Power BI to sharepoint. 

 

The output of the flow is good, but the flow does not stop as defined. 

 

At first, I was thinking maybe I shall put the 'Increment variable' outside of 'Apply to each', but not working. 

 

Then, I was thinking maybe the 'Apply to each' shall only include 'Create file in sharepoint', still not working. 

 

Could someone help me to see which step did I do wrong? The variable 'StoreIndex' does increment, but the stopping point 'StoreIndex' <= 3 is not executed. 

 

Below are two versions of this flow. 

 

0.png1.png

 

Thanks in advance. 

Categories:
  • TreeTreeTree Profile Picture
    18 on at

    I kind of figured out it was caused by referring Power BI columns while creating sharepoint files, the Power BI column involvement forced the step to be put in 'apply to each'. Without referring Power BI columns, the 'apply to each' is not automatically added. Continuing fixing the issues. This brings a point that the variable 'StoreIndex' defined in Power Automate is not equivalent to the 'StoreIndex' column I defined in Power BI. They are parallel independent code running by themselves, even though I use one to model the value of the other. 

  • Verified answer
    TreeTreeTree Profile Picture
    18 on at

    The 'Apply to each' is the cause of endless loop for this case and the cause of 'Apply to each' automatically added for a step is the referring of Power BI Columns. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 213 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 151

Last 30 days Overall leaderboard