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 with Blank Month Values

I'm trying to create a calculation that shows the cumulative totals including for the ones with no data. I have been checking similar questions in this forum but nothing has solved my issue yet. I'm adding an example table below. In this example, the cumulative total column for the country BLG should be filled with the totals from November 2017 to today adding 2000 for each month (4000 for 2017 then 24000 for 2018,2019,2020 then for January 2021, 2000 and so on). Same for the country GER in which the calculation starts from July 2019. As for the last country, since there is no recurring contribution, the cumulative total is 5000. Any ideas?

 

image.png

Adding below one of the different methods I tried without success:

I created a new calendar table with a relationship to my main table.

 

CALENDAR = CALENDAR(DATE(2017,01,01),DATE(2025,12,31)

 

Created a measure to get annual total recurring contribution (which is probably where I'm mistaken)

ANNUAL = SUM(TABLE'[Recurring Contribution])

and the running total measure

Running Total= CALCULATE([ANNUAL], DATESYTD('Calendar'[Date], "31/12"))

Unfortunately, not only this measure resets every year, it also fills the months with no value prior to my inital date: Nov/17.

 
 
1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on your description, I will choose to create a calculated table. First, I need to create a measure to calculate the value of blank date.

 

Measure = 
var contribution =  
    CALCULATE(
        SUMX(
            FILTER('Table',
                'Table'[Start Date]<=MAX('Table 2'[Date]) 
                && (ISBLANK('Table'[End Date]) || 'Table'[End Date]>MAX('Table 2'[Date]))),
            ('Table'[Recurring Contribution])),
            CROSSFILTER('Table'[Start Date],'Table 2'[Date],None))
return IF(contribution=0,SUM('Table'[One-time Contribution]),contribution)

 

Then create a  calculated table.

 

Table 3 = 
var combination = CROSSJOIN('Table 2',VALUES('Table'[Country]))
return SUMMARIZE(combination,
    'Table 2'[Date].[Year],'Table 2'[Date].[Month],'Table'[Country],
    "value",[Measure])

 

V-lianl-msft_1-1612160489281.png

 

You can refer to the sample .pbix

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on your description, I will choose to create a calculated table. First, I need to create a measure to calculate the value of blank date.

 

Measure = 
var contribution =  
    CALCULATE(
        SUMX(
            FILTER('Table',
                'Table'[Start Date]<=MAX('Table 2'[Date]) 
                && (ISBLANK('Table'[End Date]) || 'Table'[End Date]>MAX('Table 2'[Date]))),
            ('Table'[Recurring Contribution])),
            CROSSFILTER('Table'[Start Date],'Table 2'[Date],None))
return IF(contribution=0,SUM('Table'[One-time Contribution]),contribution)

 

Then create a  calculated table.

 

Table 3 = 
var combination = CROSSJOIN('Table 2',VALUES('Table'[Country]))
return SUMMARIZE(combination,
    'Table 2'[Date].[Year],'Table 2'[Date].[Month],'Table'[Country],
    "value",[Measure])

 

V-lianl-msft_1-1612160489281.png

 

You can refer to the sample .pbix

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , You can create measure like

Cumm = CALCULATE([ANNUAL],filter(allselected(Table),Table[start Date] <=max(Table[Start Date])))

 

Cumm Sales = CALCULATE([ANNUAL],filter(allselected(date),date[date] <=max(date[date])))

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

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
Top Kudoed Authors