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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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