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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.