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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
patrickbender
Helper I
Helper I

Generate new rows based on previous data

Hi,

I have two tables, one with accounting and one with forcasts.

I need to use both in order to create a view with some information I need for my accounting.

The problem is mainly with the forecasts as I need one row for each month since the start of the project until the current month.

I appreciate all help and pointers to a good read is also much appreciated.

 

Problem 1: There's not a forcast during some months (mainly summer) and that forecast needs to be the same at the previous one.

Problem 2: After the project is completed I still need to have the last forecast on a new row for each month after that as I always need a running total. 

 

Link: .pbix link 

 

My first thought was to use a date calendar which matched the forecast to the correct dates but as I want to use the numbers in calculated columns that didn't work out.

My second thought was to make one row for each month and project and then add calculated columns. I tried with a foor loop using generate series but I could only get that to work for one dimention and not two (month and project).

 

In the picture below:

Nov, Feb & Mar is not included in the datasef of the forecast table and is therefore the same as previous date for project 1

 

ProjectedRevenue: Ssum of type revenue in the foercast table grouped by date and project. 

ProjectedCost: Sum of type cost in the foercast table grouped by date and project.

Invoiced: Sum of all invoices in the accounting table until the date in the month column.

PostedCost: Sum of all posted costs in the accounting table until the date in the month column.

Picture1.png

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

So, in general, when you are trying to invent rows in DAX, you use GENERATE or GENERATESERIES


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...

Hi,
I tried the generate series as you mentioned a while back but got stuck as I need to loop though 2 dimensions, date and project. This would be fine if there was a loop in Dax but I searched for it and couldn’t find any except using a second table.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.