Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi,
I am trying to replicate a SQL do while loop.
I have a table with customers some are active some are inactive and I need to get the figures for each month end using the created and terminated dates.
In SQL I would set up a loop to do my calculation and add one month to the date in the loop to add the data to a temp table.
E.G. the example code would be if Customer was created prior to the month end and the termonation date is blank or greater than the month they where active at the month end so include in the new table.
I have am having difficulty setting this up in Power Query so that the data from the data from the customer table is added to a new table and with each loop the next months data is appended to the table and so on until teh max date is reached (the previous month end date).
I have looked at many eaxmples and they dont seem to do what I Need, if it can be done
Any help would be greatly appreciated
Solved! Go to Solution.
@Anonymous ,
You may check if the following post helps.
https://community.powerbi.com/t5/Desktop/Accumulate-sum-minus-abandoned/m-p/206947#M91174
@Anonymous ,
You may check if the following post helps.
https://community.powerbi.com/t5/Desktop/Accumulate-sum-minus-abandoned/m-p/206947#M91174
Thank you I'll take a look
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 43 | |
| 38 | |
| 35 | |
| 21 | |
| 15 |
| User | Count |
|---|---|
| 65 | |
| 58 | |
| 28 | |
| 27 | |
| 25 |