This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
Hi,
I have this page:
On Each row we have a production register, where "Nome" is the name of the product, "data" is the date when it was made and "hora" is the time that it was made, "maquina" corresponds to the machine where the product was made.
I want to calculate a measure of the average time that takes it takes to make a product based on the columns "Nome" and "maquina" in a determined period of time delimited by the column "data".
The average time would be the average of the subtraction: "hora" - "previous time" of each row value where "previous time" would be a measure to get the previous "hora" that has the same "Name", "maquina" and the same "data".
Solved! Go to Solution.
Hi, @RodrigoEmiliano
Try this:
Get previous =
CALCULATE(
MAX( 'table'[hora] ),
FILTER(
ALLEXCEPT( 'table', [Nome], [maquina], [data] ),
'table'[id] < MAX( 'table'[id] )
)
)
Average time =
AVERAGEX( 'table', MAX( 'table'[hora] ) - [Get previous] )
Or, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @RodrigoEmiliano
Try this:
Get previous =
CALCULATE(
MAX( 'table'[hora] ),
FILTER(
ALLEXCEPT( 'table', [Nome], [maquina], [data] ),
'table'[id] < MAX( 'table'[id] )
)
)
Average time =
AVERAGEX( 'table', MAX( 'table'[hora] ) - [Get previous] )
Or, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This solution just solved a problem I've been sitting on all day - and much cleaner than anything I've tried! Thank you!
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 21 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 55 | |
| 54 | |
| 46 | |
| 26 | |
| 24 |