Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Let's say I have a couple of columns in a dataset that look like this:
| Project | Stage |
| Email Migration | A |
| Email Migration | A |
| Email Migration | A |
| Email Migration | A |
| Email Migration | A |
| Email Migration | A |
| Email Migration | A |
| Laptop Replacement | B |
| Laptop Replacement | B |
| Laptop Replacement | B |
| Laptop Replacement | B |
| Office Refurb | C |
| Office Refurb | C |
| Office Refurb | C |
| Office Refurb | C |
| Office Refurb | C |
| Office Refurb | C |
| Office Refurb | C |
| Office Refurb | C |
| Office Refurb | C |
| Office Refurb | C |
| Office Refurb | C |
| Kitchen Refit | B |
| Kitchen Refit | B |
| Kitchen Refit | B |
I'd like to add in a calculated column that looks at the Stage column and assigns a numeric value to each letter group, but a different value to the first of each group. So, for instance, Stage A would be allocated the number 1, but the first of the group would be 11. Likewise stage B would be allocated the number 2, but the first for each B stage would be allocated 22 etc.
So, the column would look like this:
| Project | Stage | Value |
| Email Migration | A | 11 |
| Email Migration | A | 1 |
| Email Migration | A | 1 |
| Email Migration | A | 1 |
| Email Migration | A | 1 |
| Email Migration | A | 1 |
| Email Migration | A | 1 |
| Laptop Replacement | B | 22 |
| Laptop Replacement | B | 2 |
| Laptop Replacement | B | 2 |
| Laptop Replacement | B | 2 |
| Office Refurb | C | 33 |
| Office Refurb | C | 3 |
| Office Refurb | C | 3 |
| Office Refurb | C | 3 |
| Office Refurb | C | 3 |
| Office Refurb | C | 3 |
| Office Refurb | C | 3 |
| Office Refurb | C | 3 |
| Office Refurb | C | 3 |
| Office Refurb | C | 3 |
| Office Refurb | C | 3 |
| Kitchen Refit | B | 22 |
| Kitchen Refit | B | 2 |
| Kitchen Refit | B | 2 |
Any ideas?
Solved! Go to Solution.
@Mat42 You will need to add an Index to your table and then the problem is trivial as you can get the MIN value of the Index for the group and compare to the current value and make your decision.
@Mat42 You will need to add an Index to your table and then the problem is trivial as you can get the MIN value of the Index for the group and compare to the current value and make your decision.
Thank you @Greg_Deckler. I really need sleep and that solution is about the only thing I haven't treid.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 33 | |
| 32 | |
| 31 | |
| 26 |
| User | Count |
|---|---|
| 134 | |
| 96 | |
| 78 | |
| 67 | |
| 65 |