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 moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
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 April 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 |
|---|---|
| 34 | |
| 29 | |
| 29 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 45 | |
| 33 | |
| 24 | |
| 23 |