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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ivdzouwen
Frequent Visitor

Approach for calculating differences between rows based on conditions (Excel arrays to PowerBI)

Goodday all, 

 

I hope somebody can help me with a problem I'm having. Hopefully I can one day return the favor.

I have big dataset that I used to prepair and anlyse in excel by calculating a number of array index match functions. I like to bring this to PowerBI, I tried to transform and simulate my fucntions in DAX but with no succes. The table below illustrates my problem. 

 

In a nutshell

We have a warehouse with batches containing multiple jobs. Each job gets the same processing steps during which a measurements is done. The most interresting information is the difference in time and measurement between consequative steps. For example, to show the measurement difference tween step 3 and 4 over time. I used to use arrays to find the previous step of the job ID and than calculated diffrence since last step in column CALC. I wonder however even if trying to recreate this in PowerBI is the right approach

 

*the combination of Batchh ID, Job ID and step is unique

*Steps are consequative in time

batch IDJob IDStepDateTimestampMeasurement valueCALC
112223..## 
112224..## 
112225..## 
113334..## 
113335..## 
113336..## 
2255512..## 
226662..## 
226663..## 

 

Hope this is clear and I handeld asking it like this correctly.  Kind regards, Ivo

 

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @ivdzouwen 

 

All you need to do is add a custom column = step  +1 to your table and later use Merge Queries.

Please see the attached, this will show only technique as the sample had not enough data return any meaningful result.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @ivdzouwen 

 

All you need to do is add a custom column = step  +1 to your table and later use Merge Queries.

Please see the attached, this will show only technique as the sample had not enough data return any meaningful result.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Hello Mariusz,

wow, that looks so simple. Thank you very much. this will work for me. kind regards.

 

Hope to be able to help people in the future. kind regards.

 

I

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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