Forum Discussion
ahoggatt42
2 years agoRegular Visitor
Cumulative Sum from Two Different Tables
My company is currently using two completely seperate systmes to track sales in US vs sales for the rest of the world. Additionally we have two different types of sales, OP and UO orders. I am trying...
- Anonymous2 years ago
Hi ahoggatt42 ,
1. Create a calculation table and obtain data that meets the conditions.
Table = UNION(SELECTCOLUMNS( FILTER('AR Data','AR Data'[Order Type] = "UO"), "MyDate",'AR Data'[Order Date], "MyYear",'AR Data'[Order Year], "MyMonth",'AR Data'[Order Month], "MyPrice",'AR Data'[Sum of True Price]), SELECTCOLUMNS( FILTER('SO Data','SO Data'[Order Type] = "UO"), "MyDate",'SO Data'[Trans Date], "MyYear",'SO Data'[Trans Year], "MyMonth",'SO Data'[Trans Month], "MyPrice",'SO Data'[Sum of True Price]))2. Create measure.
Measure = CALCULATE(SUM('Table'[MyPrice]),FILTER(ALL('Table'), 'Table'[MyYear] = MAX('Table'[MyYear]) && 'Table'[MyMonth] = MAX('Table' [MyMonth]) &&'Table'[MyDate] <= MAX('Table'[MyDate])))If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ahoggatt42
2 years agoRegular Visitor
And Here is the AR Data:
| transid | partid | Order Date | Order Month | Order Year | Sum of True Price | Order Type |
| 00010993 | 29 | 3/4/2024 0:00 | 3 | 2024 | $68 | OP |
| 00010996 | 1 | 3/5/2024 0:00 | 3 | 2024 | $665 | OP |
| 00010998 | 51 | 3/5/2024 0:00 | 3 | 2024 | $98 | OP |
| 00010998 | 53 | 3/5/2024 0:00 | 3 | 2024 | $2,118 | OP |
| 00010999 | 30 | 3/6/2024 0:00 | 3 | 2024 | $68 | OP |
| 00010999 | 33 | 3/6/2024 0:00 | 3 | 2024 | $14,265 | OP |
| 00010999 | 2 | 3/6/2024 0:00 | 3 | 2024 | $568 | OP |
| 00010999 | 37 | 3/6/2024 0:00 | 3 | 2024 | $85 | OP |
| 00010999 | 10 | 3/6/2024 0:00 | 3 | 2024 | $478 | OP |
| 00010999 | 52 | 3/6/2024 0:00 | 3 | 2024 | $34 | OP |
| 00001282 | 63 | 3/6/2024 0:00 | 3 | 2024 | $26 | OP |
| 00010999 | 64 | 3/6/2024 0:00 | 3 | 2024 | $12 | OP |
| 00001282 | 66 | 3/6/2024 0:00 | 3 | 2024 | $105 | OP |
| 00010999 | 17 | 3/6/2024 0:00 | 3 | 2024 | $78 | OP |
| 00010999 | 71 | 3/6/2024 0:00 | 3 | 2024 | $2,888 | OP |
| 00011002 | 3 | 3/7/2024 0:00 | 3 | 2024 | $6,088 | OP |
| 00011002 | 39 | 3/7/2024 0:00 | 3 | 2024 | $554 | OP |
| 00011002 | 40 | 3/7/2024 0:00 | 3 | 2024 | $223 | OP |
| 00011002 | 41 | 3/7/2024 0:00 | 3 | 2024 | $602 | OP |
| 00011002 | 42 | 3/7/2024 0:00 | 3 | 2024 | $101 | OP |
| 00011002 | 43 | 3/7/2024 0:00 | 3 | 2024 | $453 | OP |
| 00011002 | 44 | 3/7/2024 0:00 | 3 | 2024 | $640 | OP |
| 00011002 | 45 | 3/7/2024 0:00 | 3 | 2024 | $101 | OP |
| 00011002 | 49 | 3/7/2024 0:00 | 3 | 2024 | $109 | OP |
| 00011002 | 54 | 3/7/2024 0:00 | 3 | 2024 | $25 | OP |
| 00011002 | 56 | 3/7/2024 0:00 | 3 | 2024 | $97 | OP |
| 00011002 | 57 | 3/7/2024 0:00 | 3 | 2024 | $11 | OP |
| 00011002 | 58 | 3/7/2024 0:00 | 3 | 2024 | $24 | OP |
| 00011002 | 62 | 3/7/2024 0:00 | 3 | 2024 | $19 | OP |
| 00011002 | 68 | 3/7/2024 0:00 | 3 | 2024 | $703 | OP |
| 00011002 | 69 | 3/7/2024 0:00 | 3 | 2024 | $11 | OP |
| 00011002 | 70 | 3/7/2024 0:00 | 3 | 2024 | $17 | OP |
| 00011001 | 22 | 3/7/2024 0:00 | 3 | 2024 | $13,019 | OP |
| 00011002 | 72 | 3/7/2024 0:00 | 3 | 2024 | $6,108 | OP |
| 00011004 | 34 | 3/11/2024 0:00 | 3 | 2024 | $43 | OP |
| 00011004 | 36 | 3/11/2024 0:00 | 3 | 2024 | $94 | OP |
| 00011008 | 32 | 3/12/2024 0:00 | 3 | 2024 | $665 | OP |
| 00011009 | 67 | 3/12/2024 0:00 | 3 | 2024 | $831 | OP |
| 00011015 | 29 | 3/15/2024 0:00 | 3 | 2024 | $68 | OP |
| 00011015 | 37 | 3/15/2024 0:00 | 3 | 2024 | $227 | OP |
| 00011015 | 46 | 3/15/2024 0:00 | 3 | 2024 | $603 | OP |
| 00011015 | 59 | 3/15/2024 0:00 | 3 | 2024 | $25 | OP |
| 00011015 | 60 | 3/15/2024 0:00 | 3 | 2024 | $73 | OP |
| 00011015 | 61 | 3/15/2024 0:00 | 3 | 2024 | $85 | OP |
| 00011015 | 22 | 3/15/2024 0:00 | 3 | 2024 | $343 | OP |
| 00011021 | 10 | 3/19/2024 0:00 | 3 | 2024 | $50 | OP |
| 00011021 | 48 | 3/19/2024 0:00 | 3 | 2024 | $112 | OP |
| 00011024 | 29 | 3/20/2024 0:00 | 3 | 2024 | $68 | OP |
| 00011024 | 2 | 3/20/2024 0:00 | 3 | 2024 | $57 | OP |
| 00011024 | 35 | 3/20/2024 0:00 | 3 | 2024 | $533 | OP |
| 00011024 | 50 | 3/20/2024 0:00 | 3 | 2024 | $3,267 | OP |
| 00011024 | 53 | 3/20/2024 0:00 | 3 | 2024 | $1,059 | OP |
| 00011024 | 65 | 3/20/2024 0:00 | 3 | 2024 | $6,460 | OP |
| 00011024 | 20 | 3/20/2024 0:00 | 3 | 2024 | $39 | OP |
| 00011036 | 31 | 3/22/2024 0:00 | 3 | 2024 | $919 | OP |
| 00011036 | 55 | 3/22/2024 0:00 | 3 | 2024 | $813 | OP |
| 00001044 | 24 | 3/26/2024 0:00 | 3 | 2024 | $274,560 | UO |
| 00011043 | 38 | 3/27/2024 0:00 | 3 | 2024 | $516 | OP |
| 00011043 | 47 | 3/27/2024 0:00 | 3 | 2024 | $209 | OP |
| 00011049 | 1 | 3/28/2024 0:00 | 3 | 2024 | $998 | OP |