The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Info needed
Solved! Go to Solution.
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
(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.
4) Expand your merged table
and
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
(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.
4) Expand your merged table
and
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |