Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello
I have two tables, one in which there is a list of devices (Devices table):
instrumentid | ver |
HPLC_00067 | 1 |
LC MSMS-00103 | 2 |
LC MSMS-00105 | 4 |
LC MSMS-00157 | 1 |
LCMSMS_00005 | 1 |
LCMSMS_00017 | 22 |
DEAC901944 | 1 |
HPLC-DAD-00100 | 2 |
The other contains a list of maintenance requests on the devices (Maintenance requests):
instrumentid | status |
HPLC_00067 | |
LC MSMS-00103 | Assigned |
LC MSMS-00105 | Canceled |
LC MSMS-00157 | Cancelled |
LCMSMS_00005 | Close |
LCMSMS_00017 | Draft |
DEAC901944 | Hold |
LC MSMS-00103 | Rejected |
LC MSMS-00105 | Resolved |
LC MSMS-00157 | Returned |
LCMSMS_00005 | SectionHead |
LCMSMS_00017 | SendBack |
DEAC901944 | Supervisor |
HPLC-DAD-00100 | Canceled |
How can I add a column to the first table (device list) that shows whether the device is available/unavailable because it is under maintenance, if there is a row in the second table and the status of the maintenance request is:
Assigned
Hold
Returned
SendBack
How can I put another column that shows the number of current maintenance requests?
Solved! Go to Solution.
pls try this
Proud to be a Super User!
what's the expected output?
e.g. for the second id, 003, there are two rows in the second table.
Proud to be a Super User!
expected output:
instrumentid | ver | Under maintenance | Number of maintenance requests |
HPLC_00067 | 1 | No | 1 |
LC MSMS-00103 | 2 | Yes | 2 |
LC MSMS-00105 | 4 | No | 2 |
LC MSMS-00157 | 1 | Yes | 2 |
LCMSMS_00005 | 1 | No | 2 |
LCMSMS_00017 | 22 | Yes | 2 |
DEAC901944 | 1 | Yes | 2 |
HPLC-DAD-00100 | 2 | No | 1 |
could you pls let me know how to get yes/no? what's the logic?
Proud to be a Super User!
yes/no Logic based on the presence of a line for the same “instrumentid” in the second table (maintenance requests), and “status” column must be = "Assigned" or "Hold" or "Returned" or "SendBack"
pls try this
Proud to be a Super User!
Okay, it worked!! Thank you very much. How could you do it without referring to the instrumentid column in the first table?
you are welcome. based on the attachment , you can see that i created relationship between two tables.
Proud to be a Super User!
User | Count |
---|---|
123 | |
69 | |
67 | |
58 | |
52 |
User | Count |
---|---|
183 | |
92 | |
67 | |
62 | |
53 |