Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
2 years ago
Solved

ACCUMULATED BY ORDER

Greetings to all.
I'm looking to make the cumulative by established order (ORDER), I've calculated it by date but I can't find the way to calculate it with a "Range" or order Number
This is my board...

ORDERREQUESTED ACCUMULATED
3119002 131282
612280 143562
733264 176826
910255 ETC…
108442
116514
132471
1624960
1813110
1914437
2032762
211873
2221253
2325052
2516140
2611303
276195
2816206
296245
304563
315900
334048
36630
4010720
4116032
424370
432887
443124
4520198
484887
4920549
5016642
5143446
5523455
5810080
5911100

  • Hi, Syndicate_Admin 

     

    You can try the following methods.
    Measure:

    Measure = CALCULATE(SUM('Table'[REQUESTED]),FILTER(ALL('Table'),[ORDER]<=SELECTEDVALUE('Table'[ORDER])))
    ACCUMULATED = MINX(FILTER(ALL('Table'),[ORDER]>SELECTEDVALUE('Table'[ORDER])),[Measure])

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • Hi Syndicate_Admin 
    You can use something like:

    acc_requested =
    VAR order_= SELECTEDVALUE('Table'[ORDER])
    RETURN
     CALCULATE( SUM('Table'[REQUESTED]), 'Table'[ORDER]<= order_,all('Table'[ORDER]))

     

    or use a window function like on the tutorial:

    https://www.youtube.com/watch?v=y9KPE6Hd1wM

     

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, Syndicate_Admin 

     

    You can try the following methods.
    Measure:

    Measure = CALCULATE(SUM('Table'[REQUESTED]),FILTER(ALL('Table'),[ORDER]<=SELECTEDVALUE('Table'[ORDER])))
    ACCUMULATED = MINX(FILTER(ALL('Table'),[ORDER]>SELECTEDVALUE('Table'[ORDER])),[Measure])

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.