Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi
Item: AAA121
Available Qty: 10
Country | Purchased | Date | Unit Price |
Brazil | 2 | 06-Jan-21 | 102 |
Austria | 4 | 11-Jan-21 | 121 |
Chile | 7 | 22-Jan-21 | 100 |
I have the Item "AAA121" available qty of 10 as inventory, but purchased in 3 countries from other source with date sorted.
Calculation i need is Brazil purchased first on 06-Jan-21, we miss to use inventory of value 2 * 102 = 204
Austria purchased secodnd 11-Jan-21, we miss to use inventory of value 4 * 121 = 484
Chilepurchased third 22-Jan-21, we miss to use inventory of value 4 (not 7 sinec we have total 10) * 100 = 400
Total Miss = 1088
Country wise miss
Brazil - 204
Austria - 484
Chile - 400
Regads
Mahes r
Solved! Go to Solution.
@mahra-in , Try a new column like
new column =
var _sum = sumx(filter(Table, [Date] <= earlier([Date])),[Purchased])
return
if(_sum<=10 , [Purchase] *[Unit Price] , (10 -(_sum -[Purchase]))*[Unit Price])
or
new column =
var _sum = sumx(filter(Table, [Item] = earlier([Item]) && [Date] <= earlier([Date])),[Purchased])
return
if(_sum<=10 , [Purchase] *[Unit Price] , (10 -(_sum -[Purchase]))*[Unit Price])
I go the result as I expected...Working further on it...If there are any issues, will post it here. Thank you very much for your support
@mahra-in , Try a new column like
new column =
var _sum = sumx(filter(Table, [Date] <= earlier([Date])),[Purchased])
return
if(_sum<=10 , [Purchase] *[Unit Price] , (10 -(_sum -[Purchase]))*[Unit Price])
or
new column =
var _sum = sumx(filter(Table, [Item] = earlier([Item]) && [Date] <= earlier([Date])),[Purchased])
return
if(_sum<=10 , [Purchase] *[Unit Price] , (10 -(_sum -[Purchase]))*[Unit Price])
User | Count |
---|---|
80 | |
74 | |
63 | |
61 | |
45 |
User | Count |
---|---|
108 | |
98 | |
89 | |
82 | |
61 |