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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Dear All
I am struggling to create a new column that copies the values from a first one but only the ones form an interval of a third
In the exampel below ( form excel) i ´d need the to get the column "Time beteween 1 and 2" by coping the column "Time" but only the rows between ( or equal ) to 1 and 2. Leaving blank otherwise
Your help will be much appreciated
Thanks
Anglo.
Solved! Go to Solution.
1)Use "Fill down" on your [class] column in power query so your second column becomes something like this:
class
1
1
1
2
2
2
2
2
1
1
2
2
2
etc.
Then, in Power Query, follow these instructions to add a row index WITHIN each group of values in your [class] column.
https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query
so it looks like this:
class, row_index_in_group
1 , 1
1 , 2
1 , 3
2 , 1
2 , 2
2 , 3
2 , 4
2 , 5
1 , 1
1 , 2
2 , 1
2 , 2
2 , 3
Now the logic should be readily apparent!
In plain english, after you "fill down" and add the row index within each grouping of 1 and 2, it logically follows from your example that ANYTHING where the class is 1 needs to be included. but when the class is 2, ONLY when it's the first instance of a 2 (the row_index_in_group is a 1).
//Mediocre Power BI Advice, but it's free!//
Worked! Thanks for your helped. Appreciated
Ok, Thanks a lot for your prompt answers. i was about to reply right now but I will work on this new aproach you give it to me. I ´ll let you know my progress. Rgds !!
1)Use "Fill down" on your [class] column in power query so your second column becomes something like this:
class
1
1
1
2
2
2
2
2
1
1
2
2
2
etc.
Then, in Power Query, follow these instructions to add a row index WITHIN each group of values in your [class] column.
https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query
so it looks like this:
class, row_index_in_group
1 , 1
1 , 2
1 , 3
2 , 1
2 , 2
2 , 3
2 , 4
2 , 5
1 , 1
1 , 2
2 , 1
2 , 2
2 , 3
Now the logic should be readily apparent!
In plain english, after you "fill down" and add the row index within each grouping of 1 and 2, it logically follows from your example that ANYTHING where the class is 1 needs to be included. but when the class is 2, ONLY when it's the first instance of a 2 (the row_index_in_group is a 1).
//Mediocre Power BI Advice, but it's free!//
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 79 | |
| 57 | |
| 51 | |
| 46 |