The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
This is how my table looks like (1.7 million rows):
I'm trying to build a running total per customer ID and date.
This is easy to express using DAX, but unfortunately I don't have enough memory on my machine (16GB RAM).
So, I'm trying to find an alternative with Power Query M using buffered tables, etc. but that it too complicated for me.
Can anyone help? Thank you so much in advance!
Hi @webportal
Has your problem been solved? I've seen an issue quite similar to yours on another platform and it has been resolved. Here is the link Grouped running total with Power Query M.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
No, it hasn't been solved.
In fact, I believe it is IMPOSSIBLE to do a running total in Power Query with a 1.7 million row table.
Yes, it largely depends on the performance of your computer. Even if the data in Power Query has not been loaded into the Desktop, the processing of the data by Power Query still consumes resources such as CPU. The amount of data is too large and the calculations are complex, which may cause Desktop to crash. You can consider removing unnecessary data in Power Query first, and use Filter Rows to reduce the amount of data before performing calculations. You can also consider pre-processing and doing calculation at the data source, then use Desktop to get the data from the data source.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I've tried to perform the calculation in a data flow within a Premium capacity and gave up after 12 hours of processing.
What data source are you using? Does it support Query folding? This might help you: Incremental refresh for datasets. Or firstly aggregate or calculate the data in the data source(such as Excel/SQL Server) before using Power BI Desktop.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It is a CSV file. It won't fit an Excel - it has 1.7 million rows 😉
Well, I don't know what to do except reducing the amount of data. 😁
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@amitchandak thanks for the tip, but I want to calculate the accumulated sales per customer so I can classify each customer at a certain moment, so the calculation is static.
@webportal , You can try the DAX column, but I doubt it can be faster than M
Cumm Sales = CALCULATE(SUM(Sales[Sales]),filter((Sales),Sales[Sales Date] <=earlier(Sales[Sales Date]) && Sales[Customer ID] =earlier(Sales[Customer ID])))
@webportal , Try a measure like
Cumm Sales = CALCULATE(SUM(Sales[Sales]),filter(allselected(Sales),Sales[Sales Date] <=max(Sales[Sales Date]) && Sales[Customer ID] =max(Sales[Customer ID])))
with a date table
Cumm Sales = CALCULATE(SUM(Sales[Sales]),filter(allselected(Date),Date[Date] <=max(Date[Date])))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
User | Count |
---|---|
83 | |
83 | |
37 | |
34 | |
32 |
User | Count |
---|---|
92 | |
79 | |
62 | |
53 | |
51 |