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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Rolling total where data rows are sporadic

Hi!  I have a Trial balance that provides the following output:

RickSchultz_0-1661298623618.png

The Entry for March 2019 for "Deposits" should be 9,897.50 but, since there were no transactions in that month for that account, the balance isn't calculated/presented.

The Measure I'm using is otherwise fine, and pretty standard:
=calculate(Sum(Data[Amount]),FILTER(all('Calendar'[Date]),'Calendar'[Date] <=max(Data[Date])))

How can I modify this so that the balance for a period shows, even if there are no transactions in that period?

Thanks!

4 REPLIES 4
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

Please modify the formula like below:

Result =
CALCULATE (
    SUM ( Data[Amount] ),
    FILTER (
        ALLEXCEPT ( Data, Data[Account name], Data[Account code] ),
        Data[Date] <= MAX ( 'Calendar'[Date] )
    )
)

 

veasonfmsft_0-1661505445756.png

Best Regards,
Community Support Team _ Eason

 

Anonymous
Not applicable

Thanks, Eason!  Unfortunately, when I put that in , I get all zeros:

RickSchultz_0-1661530958088.png

 

amitchandak
Super User
Super User

@Anonymous , This should show for each period, provided

1. Period is coming from calendar table

2. join of calendar table with fact/table is single directional

3. Calendar table is marked as Date table 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amit, and thanks for your reply!

 

1.  The period is coming from a calendar table:

RickSchultz_0-1661353385348.png

2. Join is single-directional

RickSchultz_1-1661353451993.png

3. Calendar table was NOT marked as a date table - I fixed that, but still the same issue.

 

The data type for the Date field of the calendar table is Date:

RickSchultz_2-1661353656552.png

 

The date table is made from a query that references the original "data" table it is linked to - could that be an issue?  Here's the m code to make the calendar table:
= {Number.From(List.Min(Data[Date]))..Number.From(List.Max(Data[Date]))}

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.