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
PowerbiGuRoo
Advocate I
Advocate I

Accumulate the Total of a Monthly Measure Using Dates

I have a Measure that Sums "Weighted Test Points".  It calculates the total by the slicer selected month.  This measure is working fine.  But now I have a bar graph that needs to accumulate the total for this measure.  For example, if January total is 10 and February total is 15 then the bar graph would show January as 10 and February 25.  Below is the Code for the Monthly Measure that I need to accumulate month over month.

TotalWeightedPoints  =

VAR _SelectedYear =  SELECTEDVALUE('Date'[YearNum])
VAR _SelectedMonth = SELECTEDVALUE('Date'[MonthName])


VAR _MaxDate = SELECTCOLUMNS(
                             CALCULATETABLE(
                                'Date',
                                       'Date'[YearNum] = _SelectedYear,
                                       'Date'[MonthName] =  _SelectedMonth,),
                                        "Date", MAX('Date'[Date]))

VAR _Points =
          CALCULATE(
            SUM(''FactTesting'[Points]),
                _MaxDate <= 'FactTesting'[EndingDate] && _MaxDate >= 'FactTesting'[EffectiveDate],
                'FactTesting'[Status] = "C")

RETURN
_Points

Kind Regards
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PowerbiGuRoo 

 

Thanks for the reply from lbendlin .

 

Since I don't know your data structure, I created a sample data to implement your needs for your reference. If my formula does not apply to your scenario, please provide some sample data so that we can better help you. How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.


I added an index column to my sample data to stack the values ​​of the previous month to the next month. If you use Month directly instead of the index column, the data of February will be stacked to January, because using Month directly means comparing by letter.

vxuxinyimsft_0-1729748882748.png

 

Create a measure as follows.

CumulativeValue = SUMX(FILTER(ALLSELECTED('Table'), 'Table'[Index] <= MAX('Table'[Index])), [Value1])

 

I created [Value1] just to get a measure, you can try it directly with [TotalWeightedPoints].

 

Output:

vxuxinyimsft_1-1729751561750.png

 

Best Regards,
Yulia Xu

 

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

4 REPLIES 4
Anonymous
Not applicable

Hi @PowerbiGuRoo 

 

Thanks for the reply from lbendlin .

 

Since I don't know your data structure, I created a sample data to implement your needs for your reference. If my formula does not apply to your scenario, please provide some sample data so that we can better help you. How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.


I added an index column to my sample data to stack the values ​​of the previous month to the next month. If you use Month directly instead of the index column, the data of February will be stacked to January, because using Month directly means comparing by letter.

vxuxinyimsft_0-1729748882748.png

 

Create a measure as follows.

CumulativeValue = SUMX(FILTER(ALLSELECTED('Table'), 'Table'[Index] <= MAX('Table'[Index])), [Value1])

 

I created [Value1] just to get a measure, you can try it directly with [TotalWeightedPoints].

 

Output:

vxuxinyimsft_1-1729751561750.png

 

Best Regards,
Yulia Xu

 

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

Ended up being a problem with the underlying datasource.  Thank you, your measure works.

lbendlin
Super User
Super User

You cannot measure a measure directly. Either materialize it first, or create a separate measure that implements the entire business logic.

Yes, you can.  My measure ended up working correctly.  The problem was the underlying source data.

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.