Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi everyone,
I have two tables.The first one is for Asset History The second one is for items Issue for Asset
I want the to do add new column to the second table to bring To Code
First Table (Asset Transaction):
Transaction Name | Asset Code | Start Date | End Date | To Code | To Name |
Asset Custodian Opening | 59306 | 31/12/2017 | 18/06/2019 | S00001 | EMP 1 |
Asset Transfer Custodian | 59306 | 19/06/2019 | 24/08/2020 | S00002 | EMP 2 |
Asset Transfer Custodian | 59306 | 25/08/2020 | 11/03/2022 | S00003 | EMP 3 |
Asset Transfer Custodian | 59306 | 12/03/2022 | 03/10/2022 | S00004 | EMP 4 |
Second Table (Stock Ledger):
Vr. No. | Vr. Date | Transaction Name | Asset Code | Item Code | Item Name | QTY | Amount | To Code |
101900105 | 21/09/2019 | Material Issue | 59306 | 10801010289 | Printer Ink Cartridge HP # Black 950XL # CN045AN | 1 | 117 | |
101900105 | 21/09/2019 | Material Issue | 59306 | 10801010292 | Printer Ink Cartridge HP # 951XL Yellow # CN048AN | 1 | 90 |
i try this code but not working fine.
TO Code =
VAR _occurrenceDate = SELECTEDVALUE('Stock Ledger'[Vr. Date])
VAR _occurrenceCode = SELECTEDVALUE('Stock Ledger'[Asset Code])
RETURN
CALCULATE(
SELECTEDVALUE('Asset Transaction'[To Code]),
FILTER('Asset Transaction',
_occurrenceDate >= 'Asset Transaction'[Start Date] &&
_occurrenceDate <= 'Asset Transaction'[End Date] &&
_occurrenceCode <> BLANK() &&
_occurrenceCode == 'Asset Transaction'[Asset Code]
)
)
Hello @ammar_cs_2004,
Try the below:
To Code =
VAR _occurrenceDate = 'Stock Ledger'[Vr. Date]
VAR _occurrenceCode = 'Stock Ledger'[Asset Code]
RETURN
CALCULATE(
FIRSTNONBLANK('Asset Transaction'[To Code], 1)
, _occurrenceCode == 'Asset Transaction'[Asset Code]
, _occurrenceCode <> BLANK()
, _occurrenceDate >= 'Asset Transaction'[Start Date]
&& _occurrenceDate <= 'Asset Transaction'[End Date]
)
thanks for reply but it is not working have error
(The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.)
User | Count |
---|---|
103 | |
88 | |
78 | |
71 | |
69 |
User | Count |
---|---|
113 | |
99 | |
97 | |
72 | |
68 |