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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors