cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors