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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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])

 

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])

 

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.