Forum Discussion
Running total Until Current Month
- 8 years ago
I've came across another method.
Get the first date of the POBU with first True case. i.e. Process Flow = 1
First Date = CALCULATE
(MIN(Table[PO Create Date - Date].[Date]),
FILTER(ALL('Standard Naming Detail - All - Metrics - V1'),Table[POBU]=EARLIER('Table'[POBU]) && Table [Process Flow]="1")
Once the First Date Column is created, get the Cummulative Total using the below DAX:
Pareto Total Per Month =
VAR
CurrentTotal = 'Table'[First Date]
Return
SUMX(FILTER('Table','Table'[First Date]<=CurrentTotal),'Table'[Process Flow])
Hi singhv2
Create an index column in query editor from 1
Create two calculated columns
new flow =
VAR flag =
IF (
[Process Flow] = 0,
BLANK (),
CALCULATE (
SUM ( 'table'[Process Flow] ),
FILTER ( ALLEXCEPT ( 'table', 'table'[POBU] ), [Index] <= EARLIER ( [Index] ) )
)
)
RETURN
IF ( flag > [Process Flow], 0, [Process Flow] )
total = CALCULATE(SUM([new flow]),FILTER(ALL('table'),[Index]<=EARLIER([Index])))
Best Regards
Maggie
Thanks Maggie.
I tried using the DAX, however, it's giving me Insufficient memory Error. I am running this query on 1 Million rows, in a 8 GB Laptop.
Can you help me to fix this issue.
- v-juanli-msft8 years agoCommunity Support
Hi singhv2
How about running these query respectively
flag = IF ( [Process Flow] = 0, BLANK (), CALCULATE ( SUM ( 'table'[Process Flow] ), FILTER ( ALLEXCEPT ( 'table', 'table'[POBU] ), [Index] <= EARLIER ( [Index] ) ) ) )new flow = IF ( flag > [Process Flow], 0, [Process Flow] )
total = CALCULATE(SUM([new flow]),FILTER(ALL('table'),[Index]<=EARLIER([Index])))Best regards
Maggie
- singhv28 years agoHelper I
Hi Maggie,
It's still not helping.
- singhv28 years agoHelper I
Hi Maggie,
Can you think of some alternate way.... Index <= Earlier(Index) is taking too much time to execute 1 Million rows.
- v-juanli-msft8 years agoCommunity Support
Hi singhv2
Could you try this formual in a measure
total = CALCULATE(SUM([new flow]),FILTER(ALL('table'),[Index]<=MAX([Index])))Best Regards
Maggie