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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Running Total not working

Hi all!

 

I'm new to Power BI and I'm trying to make a running total of the column 'Projection Base' based on a Date column. 
In this example, Projection Base is a measure as follows:

3. Projection Base =
IF(ISBLANK([3. Ending Balance Real]),[3. Ending Balance Budget],[3. Ending Balance Real])

I noticed that the running total is working, but from December to January (as can be seen in the image), and I need it to work from January to December. I already tried switching between the MAX and MIN functions and between the ASC and DESC orders.
Thanks for the help!

IMAGE: https://ibb.co/g6wpSFm

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Does this measure work?

 

=CALCULATE([3. Project base],DATESBETWEEN(Calendar[Date],MINX(ALL(Calendar),Calendar[Date]),MAX(Calendar[Date])))

 

Just ensure that in your visual, the Year and Month should be dragged form the Calendar Table.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

If table "Sheet1" and date table "calendar" have a relationship with a cardinality of "many to one".

please create this measure:

Measure = IF(ISBLANK(MAX(Sheet1[real])),MAX(Sheet1[budget]),MAX(Sheet1[real]))
running total 1 =
SUMX (
FILTER ( ALLSELECTED ( Sheet1 ), Sheet1[date] <= MAX ( Sheet1[date] ) ),
[Measure]
)
or running total 2 =
SUMX (
FILTER (
ALLSELECTED ( 'Sheet1' ),
ISONORAFTER ( Sheet1[date], MAX ( Sheet1[date] ), DESC )
),
[Measure]
)

1.png

 

Best Regards

Maggie

 

Anonymous
Not applicable

Hi Maggie,

 

Thanks for the answer. The problem I'm having is that columns 'budget' and 'real' are in different queries, and then the ending balance for each month, both for budget and for real values are measures. Can I work with measures?

 

Thanks in advance,

Douglas

Hi @Anonymous

'budget' and 'real' are measures and they exsit in different tables, right?

These two tables can be connected with "date" column, right?

If so, you could replace the following formula 

Measure = IF(ISBLANK(MAX(Sheet1[real])),MAX(Sheet1[budget]),MAX(Sheet1[real]))

 with this

Measure = IF(ISBLANK([real]),[budget],[real])

Best Regards

Maggie

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors