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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
LuisRuiz
New Member

Incremental SUM by Index

Hi everyone, 

 

I need some help and I gonna try to explain. I need to create a measure or a calculated column wich calculates de SUM of the row and the previous rows. There is also a condition that when we reach a new year (column Year) the measure must "restart". 

LuisRuiz_0-1663675162691.png

 

I hope someone can help me, thanx everyone!

1 ACCEPTED SOLUTION

@Greg_Deckler 

 

Hi Greg, Your DAX didn´t totally work but I used it as a base. I needed to add an allexcep in the variables like this:

LuisRuiz_0-1663676151625.png

thanks!

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@LuisRuiz Try this:

 

Measure =
  VAR __Index = MAX('Table'[Index])
  VAR __Year = MAX('Table'[Year])
  VAR __Table = FILTER(ALL('Table'),[Index] <= __Index && [Year] = __Year)
RETURN
  SUMX(__Table,[Value])

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

 

Hi Greg, Your DAX didn´t totally work but I used it as a base. I needed to add an allexcep in the variables like this:

LuisRuiz_0-1663676151625.png

thanks!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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