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
Stefano_0
Regular Visitor

cumulative sub with filter in matrix

Good morning, I have a problem with a matrix.

In this matrix there is the value of the price for month

Month Price

01        10   

02         20

03         20

04         50

05         50

 

I have also a matrix with the cumulative sum but if i use a filter for the month and I select the month 03 04 05 the value for the month 03 is the sum from month 01 to 03.

Month Price

03         50

04        100

05        100

 

Is possible exclude the month's not selected?

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

 

Picture1.png

 

Price Total Cumulate : =
CALCULATE (
SUM ( Data[Price] ),
FILTER ( ALLSELECTED ( Months ), Months[Month] <= MAX ( Months[Month] ) )
)

 

https://www.dropbox.com/s/164lhkihvp8tw3b/stefano.pbix?dl=0 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Stefano_0 ,

 

You will need ALLSELECTED() function in the formula.

Measure = CALCULATE(SUM('Table'[Price]),FILTER(ALLSELECTED('Table'[Month]),'Table'[Month]<=MAX('Table'[Month])))

9.PNG

 

Best Regards,

Jay

Stefano_0
Regular Visitor

I have set the month date with a new column

MonthDate = FORMAT(ABZ_VJS01_DOCUMENTI_ORD_CONS[DATE], "MM")

Total Price =
CALCULATE (
SUM ( ABZ_VJS01_DOCUMENTI_ORD_CONS[Price] ),
FILTER ( ALLSELECTED ( ABZ_VJS01_DOCUMENTI_ORD_CONS[MonthDate] ), ABZ_VJS01_DOCUMENTI_ORD_CONS[MonthDate] <= MAX ( ABZ_VJS01_DOCUMENTI_ORD_CONS[MonthDate] ) )
)
The result is a table without sum:

Month Price

03         20

04         50

05         50

 
Jihwan_Kim
Super User
Super User

 

Picture1.png

 

Price Total Cumulate : =
CALCULATE (
SUM ( Data[Price] ),
FILTER ( ALLSELECTED ( Months ), Months[Month] <= MAX ( Months[Month] ) )
)

 

https://www.dropbox.com/s/164lhkihvp8tw3b/stefano.pbix?dl=0 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

perfect, everything works thanks !!!

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.