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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
meleeisland
New Member

Cumulative sum of measure with underlying if statement by date

I've been struggling with this cause I don't quite understand how date filtering works.
My original measure has a separated calculation for dates before and after 2022 (it does ( A * B ) if date is < 2022 and only ( A ) if it's >= 2022, nothing more).

When I apply my running total measure to it, it brings an accumulation divided by 2022 aswell, when it should sum the result of the original measure regardless of the year. Other formulas I've tried don't even show the results prior to 2022.

 

What could I be doing wrong so that it's not all continuously accumulated?

 

Sin título.png

Measure1 =

IF ( MAX ( CALENDAR[Year] ) < 2022 ; AVERAGE ( Table[Rate] ) * CALCULATE ( [AnotherMeasure] ; ALL ( Table ) ) ; [AnotherMeasure] )

Measure2 =

VAR MaxDate = MAX ( CALENDAR[Date] )

VAR Result = CALCULATE ( [Measure1] ; CALENDAR[Date] <= MaxDate ; ALL (CALENDAR) )

RETURN Result

 

Please help me 😞

Thank you!

2 REPLIES 2
meleeisland
New Member

Thank you for your reply. That table it's just a one column bridge table with categories.
I need to make the historical total sum of Measure1 that is not reseted at any time.

wdx223_Daniel
Super User
Super User

i'm not really get your question.

but, ALL(Table) will remove all the filters of its expanded table, which may includs the filters come from CALENDAR.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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