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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
WolfDog23
Frequent Visitor

Need help use only the latest run's data, not a collection of all the individual runs.

Hi, I'm having an issue trying to figure out how to only capture information (Quantity) from our current running "LEG" for an "ID Number". II created a example to try and simplify how our database is set up. What I want to grab is the highest/most current LEG and display how many parts are "Running" today. Based on my current setup, I'm using my Status "Running" as the limiting factor as most LEG's are 1. It currently set up as an IF statement to create a new column only using data from the Quantity column and creating a new column with that data. However, sometimes we have instances were certain ID Numbers have more than one LEG. In this instance, the status for all legs will be "Running" which will result in data grabed from each run instead of only the most recent. If it's easier I do have a date column I could use to extract the most recent data, but I think the LEG number should work just the same. In the example below. 

Starting data

WolfDog23_0-1692718065133.png

Info needed

WolfDog23_1-1692718158990.png

 

 

1 ACCEPTED SOLUTION
Syk
Super User
Super User

1) Duplicate your table. You should have 2 tables, pick one to start with (I'm starting with the original table).
2) Under Transform > Group by > fill out the UI like this

Syk_1-1692721495027.png

(If you have more statuses and only want running, do that filter before this step)

3) Under Home > Merge Queries > select your duplicated table to merge and select both ID Number and LEG (hold ctrl and click to select multiple) for each of the tables.

Syk_2-1692721756781.png

4) Expand your merged table

Syk_3-1692721792997.png

and

Syk_4-1692721807245.png

 

 

 

View solution in original post

1 REPLY 1
Syk
Super User
Super User

1) Duplicate your table. You should have 2 tables, pick one to start with (I'm starting with the original table).
2) Under Transform > Group by > fill out the UI like this

Syk_1-1692721495027.png

(If you have more statuses and only want running, do that filter before this step)

3) Under Home > Merge Queries > select your duplicated table to merge and select both ID Number and LEG (hold ctrl and click to select multiple) for each of the tables.

Syk_2-1692721756781.png

4) Expand your merged table

Syk_3-1692721792997.png

and

Syk_4-1692721807245.png

 

 

 

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

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!

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.

Users online (27)