This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi,
I'm trying to add a column to the table below to calculate the 'Next ID', based on 'Last ID' and where 'Mins' is not 0, with a reset at each Product change.
Any help with this would be appreciated..
Current:
| Product | Last ID | Mins |
| Prod1 | 105 | 10 |
| Prod1 | 205 | 20 |
| Prod1 | 305 | 0 |
| Prod1 | 405 | 15 |
| Prod1 | 505 | 0 |
| Prod1 | 605 | 20 |
| Prod2 | 105 | 10 |
| Prod2 | 205 | 0 |
| Prod2 | 305 | 0 |
| Prod2 | 405 | 30 |
| Prod2 | 505 | 0 |
| Prod2 | 605 | 20 |
| Prod3 | 105 | 10 |
| Prod3 | 205 | 0 |
| Prod3 | 305 | 0 |
| Prod3 | 405 | 25 |
| Prod3 | 505 | 10 |
| Prod3 | 605 | 0 |
Expected Output:
| Product | Last ID | Mins | Next ID | |
| Prod1 | 105 | 10 | 205 | |
| Prod1 | 205 | 20 | 405 | |
| Prod1 | 305 | 0 | - | |
| Prod1 | 405 | 15 | 605 | |
| Prod1 | 505 | 0 | - | |
| Prod1 | 605 | 20 | - | |
| Prod2 | 105 | 10 | 405 | |
| Prod2 | 205 | 0 | - | |
| Prod2 | 305 | 0 | - | |
| Prod2 | 405 | 30 | 605 | |
| Prod2 | 505 | 0 | - | |
| Prod2 | 605 | 20 | - | |
| Prod3 | 105 | 10 | 405 | |
| Prod3 | 205 | 0 | - | |
| Prod3 | 305 | 0 | - | |
| Prod3 | 405 | 25 | 505 | |
| Prod3 | 505 | 10 | - | |
| Prod3 | 605 | 0 | - |
Thanks,
Jamie.
Solved! Go to Solution.
@aJamie , Create a new column like
minx(filter(Table, [Product] =earlier([Product]) && [Last ID] >earlier([Last ID]) && [Mins] <> 0 ), [Last ID])
Amazing! ..thanks so much for your help. Perfect solution.
@aJamie Try this:
* Make little tweak in @amitchandak DAX like below
@aJamie , Create a new column like
minx(filter(Table, [Product] =earlier([Product]) && [Last ID] >earlier([Last ID]) && [Mins] <> 0 ), [Last ID])
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 |
|---|---|
| 32 | |
| 25 | |
| 23 | |
| 22 | |
| 13 |
| User | Count |
|---|---|
| 61 | |
| 47 | |
| 27 | |
| 24 | |
| 19 |