Forum Discussion
Custom Column for Cummulative TR in power query
- Anonymous1 year ago
Hi chaitanya1 ,
Please try like:
Cumulative TR = VAR __curr_index = 'Table'[Index] VAR __result = CALCULATE(SUM('Table'[TR]), FILTER(ALL('Table'), 'Table'[Index] <= __curr_index)) RETURN __resultor:
Cumulative TR = VAR __curr_index = 'Table'[Index] VAR __result = CALCULATE(SUM('Table'[TR]), 'Table'[Index] <= __curr_index, ALLEXCEPT('Table','Table'[Index])) RETURN __resultBest Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
bhanu_gautam i have 2.5 million rows in table it is taking hours by using this List.Sum(List.FirstN) reading and loading every row there is any alternative to that please i have try same method before.
- danextian1 year ago
Super User
Hi bhanu_gautam
Why create this using M? While it is feasible, generating a cumulative value column in a table with 2.5 million rows will be computationally expensive and slow if it doesn't time out altogether. I've attempted this with rows generated entirely within the query editor, and that one even timed out. Handling external data with additional ETL processes applied would only make it even worse. It is better off handled as a DAX measure or be pushed to the source.
- chaitanya11 year ago
Helper I
bhanu_gautam can you help me with that DAX i am not getting cumulative view through DAX.
- Anonymous1 year agoNot applicable
Hi chaitanya1 ,
Please try like:
Cumulative TR = VAR __curr_index = 'Table'[Index] VAR __result = CALCULATE(SUM('Table'[TR]), FILTER(ALL('Table'), 'Table'[Index] <= __curr_index)) RETURN __resultor:
Cumulative TR = VAR __curr_index = 'Table'[Index] VAR __result = CALCULATE(SUM('Table'[TR]), 'Table'[Index] <= __curr_index, ALLEXCEPT('Table','Table'[Index])) RETURN __resultBest Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum