Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
122 | |
80 | |
47 | |
44 | |
35 |
User | Count |
---|---|
182 | |
83 | |
70 | |
47 | |
45 |