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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

New column having into acount previous rows values

 

Hi,

I want a new column that takes into account the values from previous rows.

If "Status" equals to "Resolved", in this row or in previous rows, in new column we should show the value of "Time" column. Otherwise, if in previous rows we haven´t found any Resolved "Status" we should show 0 in the column.

Rows are grouped with "ID" coulmn

 

In this image, "DAX" column shows what we are looking for:Imagen1.jpg

 

Thanks

 

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, I create a table to test:

31.png

Please take following steps:

1)Add an index column to table:

32.png

2)After Close&Apply, create a column:

DAX =

var Resolve = CALCULATE(MIN('Table'[Index]),FILTER('Table','Table'[ID]=EARLIER('Table'[ID]) && 'Table'[Status]= "Resolved"))

return 

IF([Index]<Resolve,0,[Time])

3)The result shows:

33.png

Here is my test pbix file:

pbix 

 

Best Regards,

Giotto Zhi

View solution in original post

1 REPLY 1
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, I create a table to test:

31.png

Please take following steps:

1)Add an index column to table:

32.png

2)After Close&Apply, create a column:

DAX =

var Resolve = CALCULATE(MIN('Table'[Index]),FILTER('Table','Table'[ID]=EARLIER('Table'[ID]) && 'Table'[Status]= "Resolved"))

return 

IF([Index]<Resolve,0,[Time])

3)The result shows:

33.png

Here is my test pbix file:

pbix 

 

Best Regards,

Giotto Zhi

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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