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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
LaurieS
Helper I
Helper I

Using DAX Loops - Can it work for this?

I'm trying to create a table visual (as below), where I can specify the starting point, and then use the output from the previous month to calculate the output for the next, and so on. I'll try to explain the best way I can.

 

I'm staring with the value for 1081 for 12/31/2019 (that is a static value). I then want to take that value and use it in a calculation for the next month(s) output.

Example:

Jan2020: 1081+341-453 = 969

Feb2020: 969+352-271=1050... and so on

Capture.PNG

I started with the following DAX, but this obviously won't work throughout (so I stuck a temporary blank in there for result after Jan). 

Capture2.PNG

I'm assuming I need a loop so I can store the previous output in a variable to use in the next month's calculation. I am pretty good with DAX, but not familiar enough to understand the looping mechanism needed for something like this. Any direction would be greatly appreciated.

 

Thanks, Laurie

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

2 REPLIES 2
wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1611882146273.png

 

Thank you so much! Works perfectly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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