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.
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])
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |