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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
KH11NDR
Helper IV
Helper IV

Running total, by Project ID column

Hi Guys

 

I Need the running totals each month in a column for the Days column grouped by Project ID.

 

Thanks Guys

 

Project IDDaysDateRunning Total Days
AA1601/01/201816
AA2001/02/201836
AA2001/03/201856
AA2001/04/201876
BB101/01/20181
BB101/02/20182
BB601/03/20188
BB701/04/201815
1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

they do work for me - is the Table[Date] of data type Date? Other than that I cannot think of other reason for it not to work
Capture.PNGCapture2.PNG



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

10 REPLIES 10
Stachu
Community Champion
Community Champion

syntax for calculated column

Running Total Days = 
VAR Project = 'Table'[Project ID]
VAR CurrentDate = 'Table'[Date]
RETURN
CALCULATE(SUM('Table'[Days]),FILTER('Table','Table'[Project ID]=Project &&'Table'[Date]<=CurrentDate))

syntax for a measure - summary for a project gives the sum for the latest date for that project

Running Total Days Measure = 
VAR Project = SELECTEDVALUE('Table'[Project ID])
VAR CurrentDate = MAX('Table'[Date])
RETURN
CALCULATE(SUM('Table'[Days]),'Table'[Project ID]=Project,'Table'[Date]<=CurrentDate)


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Stachu.

 

None of those worked, In the measure, it gives me the same days as they are in each month, no rolling totals.

Stachu
Community Champion
Community Champion

they do work for me - is the Table[Date] of data type Date? Other than that I cannot think of other reason for it not to work
Capture.PNGCapture2.PNG



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

@Stachu

 

I've got it working, I've got a further filter, which divides the data by three, If I filter on it manually and divide your column y 3, I get exactly what I'm looking for.

 

Is there obviously a way to filter on two columns?

Stachu
Community Champion
Community Champion

I don't get the question.
in the syntax I posted there is filter on Table[Project ID] & Table[Date], so 2 columns are filtered with AND operator, you can add more columns in the same manner



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

@Stachu 

 

Ignore the last question, I'ts working stop on, thanks.

 

Column Date is Date Type

 

Ok, Maybe because in my real data model it's grouped by Product ID and another column called "ReportingDate".  

Stachu
Community Champion
Community Champion

Is ReportingDate coming from the same table, or from other table connected via join?
If the latter is the case then all Table[Date] syntax should be replaced with TableName[ReportingDate]



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Zubair_Muhammad
Community Champion
Community Champion

@KH11NDR

 

Column =
CALCULATE (
    SUM ( [Days] ),
    FILTER (
        ALLEXCEPT ( Table1, Table1[Project ID] ),
        [Date] <= EARLIER ( [Date] )
    )
)

No that never worked, That's what I tried myself first.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.