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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

sum with the next value

hello everyone , i need help with this, i am new in this 

 

 

i need next row - row

 

AlanMunoz_0-1593559086053.png

 

i have this but is wrong

testc =
VAR LAST =
CALCULATE (
max( 'ENE 2020'[Index]);
'ENE 2020';
'ENE 2020'[DETALLE MAQUINARIA] = EARLIER ( 'ENE 2020'[DETALLE MAQUINARIA] );
'ENE 2020'[Index] < EARLIER ( 'ENE 2020'[Index] )
 
) +0
RETURN
IF (
LAST = 0;
'ENE 2020'[HORÓM.];
'ENE 2020'[HORÓM.]
- CALCULATE ( SUM ( 'ENE 2020'[HORÓM.]); 'ENE 2020'; 'ENE 2020'[Index] = LAST )
)
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,Try as New columns

next date = Minx(filter('ENE 2020',[DETALLE MAQUINARIA] = EARLIER ([DETALLE MAQUINARIA] ) && [FECHA] > EARLIER ([FECHA] ) ), [FECHA])
next Value = Minx(filter('ENE 2020',[DETALLE MAQUINARIA] = EARLIER ([DETALLE MAQUINARIA] ) && [FECHA] =EARLIER ([next date] ) ), [HOROM])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous ,Try as New columns

next date = Minx(filter('ENE 2020',[DETALLE MAQUINARIA] = EARLIER ([DETALLE MAQUINARIA] ) && [FECHA] > EARLIER ([FECHA] ) ), [FECHA])
next Value = Minx(filter('ENE 2020',[DETALLE MAQUINARIA] = EARLIER ([DETALLE MAQUINARIA] ) && [FECHA] =EARLIER ([next date] ) ), [HOROM])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Ashish_Mathur
Super User
Super User

Hi,

If the numbers i the third column are always in ascending order (as is the case in your example), then try this calculated column formula

=Calculate(min('ENE 2020'[HORÓM.]),filter('ENE 2020','ENE 2020'[DETALLE MAQUINARIA]=earlier('ENE 2020'[DETALLE MAQUINARIA])))-'ENE 2020'[HORÓM.]

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Measure =
var d=SELECTEDVALUE('Table'[Date])
var n = CALCULATE(min('Table'[Date]),'Table'[Date]>d)
var r= CALCULATE(sum('Table'[Value]),'Table'[Date]=n) - sum('Table'[Value])
return r

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors