Forum Discussion
Calculate NPI (non-productive Inventories in DAX
Hi,
I want to calculate NPI ( non productive Inverntories) on power bi. I have stock movements table like this.
| Date | Product Code | Quantity | Price |
| 1.01.2018 | B | 5 | 10 |
| 2.01.2018 | B | 6 | 10 |
| 3.01.2018 | B | 7 | 10 |
| 4.01.2018 | B | 8 | 10 |
| 5.01.2018 | B | 345 | 11 |
| 6.01.2018 | B | -22 | 12 |
| 7.01.2018 | B | -76 | 12 |
| 8.01.2018 | B | 243 | 12 |
| 9.01.2018 | B | 3 | 11 |
| ######## | B | -63 | 11 |
| ######## | B | 12 | 12 |
I must do calculation, find result such as bellow
| Date | Product Code | Quantity | Price | |
| 1.01.2018 | B | 5 | 10 | |
| 2.01.2018 | B | 6 | 10 | |
| 3.01.2018 | B | 7 | 10 | |
| 4.01.2018 | B | 8 | 10 | |
| 5.01.2018 | B | 345 | 11 | 210 |
| 6.01.2018 | B | -22 | 12 | 0 |
| 7.01.2018 | B | -76 | 12 | 0 |
| 8.01.2018 | B | 243 | 12 | 243 |
| 9.01.2018 | B | 3 | 11 | 3 |
| 10.01.2018 | B | -63 | 11 | 0 |
| 11.01.2018 | B | 12 | 12 | 12 |
| Total Stock | 468 |
Thanks
8 Replies
- sPowerBiFrequent Visitor
Hi,
I want to calculate NPI ( non productive Inverntories) on power bi. I have stock movements table like this.
Date Product Code Quantity Price 1.01.2018 B 5 10 2.01.2018 B 6 10 3.01.2018 B 7 10 4.01.2018 B 8 10 5.01.2018 B 345 11 6.01.2018 B -22 12 7.01.2018 B -76 12 8.01.2018 B 243 12 9.01.2018 B 3 11 ######## B -63 11 ######## B 12 12 I must do calculation, find result such as bellow
Date Product Code Quantity Price 1.01.2018 B 5 10 2.01.2018 B 6 10 3.01.2018 B 7 10 4.01.2018 B 8 10 5.01.2018 B 345 11 210 6.01.2018 B -22 12 0 7.01.2018 B -76 12 0 8.01.2018 B 243 12 243 9.01.2018 B 3 11 3 10.01.2018 B -63 11 0 11.01.2018 B 12 12 12 Total Stock 468 Thanks
- v-huizhn-msft
Microsoft Employee
Hi sPowerBi,
What's your calculation rules? How did you get the following column? Please list an example for more details, otherwise we can not help you.
Thanks,
Angelia- sPowerBiFrequent Visitor
Hi,
This is movement table. And total stock quantity equal 468 on 11 January 2018.
If the quantity is less than zero then the tansaction is the sales movement. If the quantity is greater than zero then the transaction is the buy movement. so I want to find which buying movements the stock consist of. I find out which buying movements by reducing Quantity of movement from total stock
I hope i can tell.
Thanks