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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.