Forum Discussion
Running Total with multiple criteria
- 3 years ago
Hi paulomartins
Your thought is in the correct direction. You can use ALLEXCEPT function in the DAX. Try creating a calculated column with below DAX.
Running Total = VAR currentIndex = 'Table'[Index] RETURN CALCULATE(SUM('Table'[QUANTITY]),ALLEXCEPT('Table','Table'[SKU],'Table'[DATE]),'Table'[Index]<currentIndex) + 0The "There is not enough memory to complete this operation. " error usually occurs when your computer doesn't have enough memory to perform the operation. When you use Power BI Desktop, all data in the model is loaded into memory. And creating a calculated column will add more data size to the model. If the data size is huge, you may have this error. You can turn off not used applications on the same computer to save memory space. If possible, you can consider removing unnecessay data in the model to reduce the data size. Data reduction techniques for Import modeling - Power BI | Microsoft Docs
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi paulomartins
Your thought is in the correct direction. You can use ALLEXCEPT function in the DAX. Try creating a calculated column with below DAX.
Running Total =
VAR currentIndex = 'Table'[Index]
RETURN
CALCULATE(SUM('Table'[QUANTITY]),ALLEXCEPT('Table','Table'[SKU],'Table'[DATE]),'Table'[Index]<currentIndex) + 0
The "There is not enough memory to complete this operation. " error usually occurs when your computer doesn't have enough memory to perform the operation. When you use Power BI Desktop, all data in the model is loaded into memory. And creating a calculated column will add more data size to the model. If the data size is huge, you may have this error. You can turn off not used applications on the same computer to save memory space. If possible, you can consider removing unnecessay data in the model to reduce the data size. Data reduction techniques for Import modeling - Power BI | Microsoft Docs
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Thank you so much for your help, unfortunely this DAX is calculating a huge data (around 12-13 milions of rows), the final solution I found was to do it in SQL inside my company datalake and let it to processing.
Again, thanks for your help, this code works when I reduce the size of data. 😄