Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
japolo
Frequent Visitor

Rows or values present between two row values

Hi,

I've ran into a question that seems complicated to decipher. I have a dataset where an initiated session has multiple rows, where every action is in sequential order. What I want to look at is the first value where label is e.g., "planner2d", then look at when the "planner3d" is present during the sequence. If it comes immediatelly after, it can return 1, and if there is a certain event happening in between, the number of rows in between can be returned, in the image, it would return 27.

Is it possible to check the first value in a column within the same session, and check when the next set value appears? I've tried creating a separate column but I can't figure out the count between, is this doable?

Thank you in advance!

japolo_0-1666252961769.png

 

/J

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @japolo 

Thanks for reaching out to us.

you can try this

Difference = 
var _id1=MINX(FILTER('Table','Table'[label]="planner2d"),[sequence_nbr])
var _id2=MINX(FILTER('Table','Table'[label]="planner3d"),[sequence_nbr])
return _id2-_id1-1

vxiaotang_1-1666332315500.png

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xiaotang ,
I've tried it but it doesn't work for me. I'm not sure if your solution is created based on just one id for example, but mine seems to check if there is a label and returns the first number, which is always 0.

japolo_0-1666353299646.png

There are lots of IDs with their own number of sequences. I've tried with calculate and removing filters from the id but that just returns the sequence number

Edit:
Since the step can happen at different sequential steps, I need the filter on the id to stay, but the calculate doesn't work propely

japolo_1-1666354613666.png

 

/J

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors