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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

calculate between different row and columns if conditions are met

ychua4_0-1661841255378.png

Would like to calculate the time difference between end and start if Index = test2 and then create a new column reflecting the value difference... any help would be greatly appreciated! Still in the midst of transforming the data inside Power Query Editor

1 ACCEPTED SOLUTION
Anonymous
Not applicable

managed to resolve this w help from a power query M guru from youtube...

ychua4_0-1661845738171.png

Refer to Previous Row for Subgroups in Power Query - YouTube

Thank you all for viewing and have a nice day!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi,

From what I understand, and what is seen in the picture, the index column doesn't match the [test2] column in any row. But if you want to create the formula I would suggest doing so in DAX after your transformation is done. I 'd do something like this: 

Dif = if("TableName"[Index]= "TableName"[test2],DATEDIFF("TableName"[start],"TableName"[end]),#Not sure what you want if it returns false

I hope that helps.
Anonymous
Not applicable

managed to resolve this w help from a power query M guru from youtube...

ychua4_0-1661845738171.png

Refer to Previous Row for Subgroups in Power Query - YouTube

Thank you all for viewing and have a nice day!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.