Forum Discussion
Power BI formula needed
Ryan I have tried your formula, need further help, I calculated the Index for each unique value i.e. Inventory Key with below formula
I have useded your formula to calculate the Balance Qty, below is the formula.
Balance qty values are not what I was expecting, my desire outcome is column "Expected Output" in the below tabel which I have calculated manually.
Please help me to get the Expected Output value calculation formula
| Inventory Key | Depot | Material | Order Quantity(Item) | Order Booked Date | Inventory Key | Opening Inventory | Sales Order Total | Index | Balance Qty | Expected Output |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 4 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 352 |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 16 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 336 |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 10 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 326 |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 8 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 318 |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 1 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 317 |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 2 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 315 |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 2 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 313 |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 2 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 311 |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 2 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 309 |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 4 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 305 |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 1 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 304 |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 4 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 300 |
| 933001990099911031/8/2025 | 1103 | 9330019900999 | 10 | 08-Jan-25 | 933001990099911031/8/2025 | 356 | 66.00 | 36160 | 290 | 290 |
| 933001990099911041/8/2025 | 1104 | 9330019900999 | 4 | 08-Jan-25 | 933001990099911041/8/2025 | 472 | 116.00 | 36171 | 356 | 468 |
| 933001990099911041/8/2025 | 1104 | 9330019900999 | 4 | 08-Jan-25 | 933001990099911041/8/2025 | 472 | 116.00 | 36171 | 356 | 464 |
| 933001990099911041/8/2025 | 1104 | 9330019900999 | 4 | 08-Jan-25 | 933001990099911041/8/2025 | 472 | 116.00 | 36171 | 356 | 460 |
| 933001990099911041/8/2025 | 1104 | 9330019900999 | 12 | 08-Jan-25 | 933001990099911041/8/2025 | 472 | 116.00 | 36171 | 356 | 448 |
| 933001990099911041/8/2025 | 1104 | 9330019900999 | 2 | 08-Jan-25 | 933001990099911041/8/2025 | 472 | 116.00 | 36171 | 356 | 446 |
| 933001990099911041/8/2025 | 1104 | 9330019900999 | 6 | 08-Jan-25 | 933001990099911041/8/2025 | 472 | 116.00 | 36171 | 356 | 440 |
| 933001990099911041/8/2025 | 1104 | 9330019900999 | 6 | 08-Jan-25 | 933001990099911041/8/2025 | 472 | 116.00 | 36171 | 356 | 434 |
| 933001990099911041/8/2025 | 1104 | 9330019900999 | 40 | 08-Jan-25 | 933001990099911041/8/2025 | 472 | 116.00 | 36171 | 356 | 394 |
| 933001990099911041/8/2025 | 1104 | 9330019900999 | 28 | 08-Jan-25 | 933001990099911041/8/2025 | 472 | 116.00 | 36171 | 356 | 366 |
| 933001990099911041/8/2025 | 1104 | 9330019900999 | 2 | 08-Jan-25 | 933001990099911041/8/2025 | 472 | 116.00 | 36171 | 356 | 364 |
| 933001990099911041/8/2025 | 1104 | 9330019900999 | 2 | 08-Jan-25 | 933001990099911041/8/2025 | 472 | 116.00 | 36171 | 356 | 362 |
| 933001990099911041/8/2025 | 1104 | 9330019900999 | 6 | 08-Jan-25 | 933001990099911041/8/2025 | 472 | 116.00 | 36171 | 356 | 356 |
Hi, Anonymous
As ryan_mayu says, you can't get the results you expect without indexed columns. Your data has no unique recursive values, and using Dax to calculate indexed columns doesn't quite work. You need to add the index column to the power query.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.