Forum Discussion
Running Total Breaks when Adding Top N
- 5 years ago
Sburi2
I made a sample file. as you can see, I filtered by top 3, and still, the result is correct. In your initial posting of the question, you had used ALLSELECTED when you calculated the all appname total, you should use ALL. check my formula below: I attached the file as well.Cummulative = var __current = [Total Sales] var __all = CALCULATE( [Total Sales] , ALLSELECTED(financials[Product])) var __cumm = CALCULATE( [Total Sales], FILTER( ALLSELECTED(financials[Product]), [Total Sales] >= __current ) ) return DIVIDE( __cumm , __all ) - 5 years ago
Sburi2
When you posted the question initially, I noticed that you had used ALL instead of ALLSELECTED. It was one reason for the incorrect results when you applied TOPn filter. Apart from that you also had applied some other filters.ar __all = CALCULATE( [Total Sales] , ALLSELECTED(financials[Product]))
Indeed, thanks! Just wish I knew what was wrong!
- Fowmy5 years agoSuper User
Sburi2
When you posted the question initially, I noticed that you had used ALL instead of ALLSELECTED. It was one reason for the incorrect results when you applied TOPn filter. Apart from that you also had applied some other filters.ar __all = CALCULATE( [Total Sales] , ALLSELECTED(financials[Product]))