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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
madhas
Frequent Visitor

Nested For Loops

Hi all,

 

I need to plot a chart for which I should perform a 3 set of nested loops. The logic is elaborated a bit in detail in below image. 

The plot should be arrSum vs KW.

madhas_0-1674736811929.png

 

 

 

 

Is there any Idea how to translate it to DAX? I read some posts on how to build nested loops with EARLIER, but first I could not use them for this piece of code, and second using EARLIER function does not pop up any intellisense to pick the right column. Therefor I suspected the formula and could not bring it to an end. What I could sofar figure out, is that I can from the above syntax probably I can omit the most outer For loop in DAX and replace it with having KW as the X axis. 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@madhas See if this helps: For Loop - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thanks, that was helpful but did not solve my problem. Do you have something also for nested loops? I can't figure out how to pass some parameters between loops using this method. 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors