Forum Discussion
Power BI formula needed
Anonymous
you can try this
1. create an index column in PQ
2. use DAX to create the column
Thank you Ryan
Data set is huge around 11-13 lakh row, is there any way I can get the same result without using the Index
- ryan_mayu1 year ago
Super User
I didn't see any other column which is similar to index column that we can use in the DAX.
Let's see if any one else can provide better solution for you.
- Anonymous1 year agoNot applicable
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 formulaInventory 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 - ryan_mayu1 year ago
Super User
do not use DAX to create an index column ,just create it in the power query
Column = 'Table'[Opening Inventory]- sumx(FILTER('Table','Table'[Depot]=EARLIER('Table'[Depot])&&'Table'[Index.1]<=EARLIER('Table'[Index.1])),'Table'[Order Quantity(Item)])pls see the attachment below
- danextian1 year ago
Super User
You will need to add an index column if you want it to be evaluated for each row. We cannot use the order date and quantity column as the values repeat. And also, with that much row, I dont think a calculated column is a good option - it's computationally expensive.
- Anonymous1 year agoNot applicable
Material_Location_Order Booked Date is the key that I want to use to calculate the Day Level Order Balance Qty in Power BI not in Power Query
- danextian1 year ago
Super User
Your sample data has repeating values for those columns so if the calculation were to be for each row in the sample data, there needs to be a column that identifies the row thus the use of an index column. But even if there already is an index column, creating a calculated column with that much rows would be computationally expensive.