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.
Good day people,
I have two tables, one called "Times" and the other called "Operations". Both tables have an operation ID. The "Times" table contains data about the status of the operation and the time that the status begin for all of the possible statues. I would like to add a new column to the "Operations" table with the time an specific status began. Also, an operation can start the same status many times. I would like to have a column for the first time, one column for the second time...
"Times" table looks like this:
ID | New Status | Time |
1 | A | 18/2/2019 14:21:36 |
1 | B | 18/2/2019 18:30:00 |
1 | A | 19/2/2019 7:30:00 |
2 | A | 18/2/2019 9:30:00 |
2 | B | 18/2/2019 11:20:00 |
3 | A | 19/2/2019 7:30:00 |
3 | B | 19/2/2019 9:30:00 |
3 | C | 19/2/2019 11:30:00 |
3 | D | 19/2/2019 14:30:00 |
The "Operations" table just have the operation id.
I want to add columns so it looks like this:
ID | Time first A | Time second A | Time first B | Time first C | Time first D |
1 | 18/2/2019 14:21:36 | 19/2/2019 7:30:00 | 18/2/2019 18:30:00 | ||
2 | 18/2/2019 9:30:00 | 18/2/2019 11:20:00 | |||
3 | 19/2/2019 7:30:00 | 19/2/2019 9:30:00 | 19/2/2019 11:30:00 | 19/2/2019 14:30:00 |
I have been traying to use the SELECTCOLUMS and RELATEDTABLE functions but I have not figure out how both works.
Thanks for your help!
Hi @danielmbaquero ,
You should do it using Power Query.
Can you paste both tables here ? Also the structure should be little bit different, like a column to order the status number (if repeated).
So you can achieve the visual using matrix.
@danielmbaquero it is pretty straight forward except, do you want second time only for "A" or others as well?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k I want the second for others as well. And there can be a third, fourth... for all statues
@camargos88 answer about the structure can be right. Maybe the structure should looks like this:
ID | Status | Re-process | Time |
1 | A | First time | ..... |
1 | A | Second time | ..... |
1 | B | First time | ..... |
2 | A | First time | ..... |
2 | B | First time | ..... |
@danielmbaquero with simple DAX I already got this
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
117 | |
104 | |
77 | |
73 | |
52 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |