Forum Discussion
Removing cumulative frequency using power(m) query
- 5 years ago
Hi pwrbiadm ,
Create an index sorted by date time column.
To refer to the previous row add a Custom Column.
try #"Added Index" [#" B "] {[Index] - 1} otherwise nullReplace the "null" with 0 in previous column.
Create the conditional column.
if [#" B "] = null then 0 else if [#" B "] >= [Previous] then [#" B "] - [Previous] else [#" B "]Remove unnecessary columns.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - 5 years agoColumn = var e = CALCULATE(MAX(Query4[B]),FILTER(Query4,Query4[Index]=EARLIER(Query4[Index])-1))var f = Query4[B]return IF(f=0,0,IF(f>=e,f-e,e))
I was able to use the below query for a dax calculated column which gave me the desired results without taking a long time to process the large dataset. Had to create an index column first in power query.
I was able to use the below query for a dax calculated column which gave me the desired results without taking a long time to process the large dataset. Had to create an index column first in power query.