Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
Please help me with subtotal of negative value in single row and adding it with a positive value without splitting the row
Amount
27733.51 |
-6201900.18 |
6177381.24 |
-77460.65 |
96124 |
-164075.37 |
164222 |
-164075.37 |
164222 |
-164075.37 |
164222 |
-107457.97 |
107554 |
-127615.96 |
127730 |
-34430.54 |
34465 |
-153512.81 |
153650 |
-163591.81 |
163738 |
-92810.06 |
92893 |
-298319.41 |
Solved! Go to Solution.
Hi Nathaniel,
Thank you for your reply please find the details and let me know if you are able to understand my query.
Yes need to split the single to get the output.
Document Date | Amount in doc. curr. | Subtotal Positive Values(Amount in doc. curr.) more than 1 Output 1 | Total of Value(Amount in doc. curr.) less than 0 Output 2 | Total of Negative Value(-16197615.03+Subtotal of Positive Value) Output 3 |
31-10-2021 | 27733.51 | -6201900.18 | -16169881.52 | |
31-10-2021 | -6201900.18 | -77460.65 | -9992500.28 | |
31-10-2021 | 6177381.24 | -164075.37 | -9896376.28 | |
30-09-2021 | -77460.65 | -164075.37 | -9732154.28 | |
23-09-2021 | 96124 | -164075.37 | -9567932.28 | |
01-10-2021 | -164075.37 | -107457.97 | -9403710.28 | |
24-09-2021 | 164222 | -127615.96 | -9296156.28 | |
01-10-2021 | -164075.37 | -34430.54 | -9168426.28 | |
24-09-2021 | 164222 | -153512.81 | -9133961.28 | |
01-10-2021 | -164075.37 | -163591.81 | -8980311.28 | |
24-09-2021 | 164222 | -92810.06 | -8816573.28 | |
01-10-2021 | -107457.97 | -298319.41 | -8723680.28 | |
24-09-2021 | 107554 | -184541.08 | -8425094.28 | |
01-10-2021 | -127615.96 | -164510.98 | -8240388.28 | |
24-09-2021 | 127730 | -127596.97 | -8075730.28 | |
04-10-2021 | -34430.54 | -216945.13 | -7948019.28 | |
27-09-2021 | 34465 | -124299.92 | -7730880.28 | |
04-10-2021 | -153512.81 | -88004.36 | -7606469.28 | |
27-09-2021 | 153650 | -125634.73 | -7518386.28 | |
04-10-2021 | -163591.81 | -23637.34 | -7392639.28 | |
27-09-2021 | 163738 | -98490.41 | -7368978.28 | |
04-10-2021 | -92810.06 | -64018.92 | -7270389.28 | |
27-09-2021 | 92893 | -171185.02 | -7206306.28 | |
04-10-2021 | -298319.41 | -114399.77 | -7034968.28 | |
27-09-2021 | 298586 | -99440.14 | -6920466.28 | |
04-10-2021 | -184541.08 | -119750 | -6820937.28 | |
27-09-2021 | 184706 | -49491 | -6701080.28 | |
04-10-2021 | -164510.98 | -140522 | -6651539.28 | |
27-09-2021 | 164658 | -113436 | -6510891.28 | |
04-10-2021 | -127596.97 | -82038 | -6397354.28 | |
27-09-2021 | 127711 | -153218.08 | -6315243.28 | |
04-10-2021 | -216945.13 | -133116.04 | -6161888.28 | |
27-09-2021 | 217139 | -49595.68 | -6028653.28 | |
04-10-2021 | -124299.92 | -392974.82 | -5979013.28 | |
27-09-2021 | 124411 | -152298.9 | -5585687.28 | |
04-10-2021 | -88004.36 | -132026.02 | -5433254.28 | |
27-09-2021 | 88083 | -148817.01 | -5301110.28 | |
04-10-2021 | -125634.73 | -155374.15 | -5152160.28 | |
27-09-2021 | 125747 | -99440.14 | -4996647.28 | |
04-10-2021 | -23637.34 | -166459.24 | -4897118.28 | |
27-09-2021 | 23661 | -102597.31 | -4730510.28 | |
05-10-2021 | -98490.41 | -138842.92 | -4627821.28 | |
28-09-2021 | 98589 | -146134.72 | -4488854.28 | |
05-10-2021 | -64018.92 | -131258.7 | -4342573.28 | |
28-09-2021 | 64083 | -130762.14 | -4211197.28 | |
05-10-2021 | -171185.02 | -75018.96 | -4080318.28 | |
28-09-2021 | 171338 | -45141.81 | -4005232.28 | |
05-10-2021 | -114399.77 | -158252.58 | -3960045.28 | |
28-09-2021 | 114502 | -176340.41 | -3801649.28 | |
05-10-2021 | -99440.14 | -14583.97 | -3625151.28 | |
28-09-2021 | 99529 | -32748.22 | -3610554.28 | |
12-10-2021 | -119750 | -3605345.94 | -3577773.28 | |
05-10-2021 | 119857 | -3397625.28 | ||
12-10-2021 | -49491 | 179987.15 | ||
05-10-2021 | 49541 | |||
12-10-2021 | -140522 | |||
05-10-2021 | 140648 | |||
12-10-2021 | -113436 | |||
05-10-2021 | 113537 | |||
12-10-2021 | -82038 | |||
05-10-2021 | 82111 | |||
16-10-2021 | -153218.08 | |||
08-10-2021 | 153355 | |||
16-10-2021 | -133116.04 | |||
08-10-2021 | 133235 | |||
16-10-2021 | -49595.68 | |||
08-10-2021 | 49640 | |||
18-10-2021 | -392974.82 | |||
11-10-2021 | 393326 | |||
19-10-2021 | -152298.9 | |||
12-10-2021 | 152433 | |||
19-10-2021 | -132026.02 | |||
12-10-2021 | 132144 | |||
20-10-2021 | -148817.01 | |||
13-10-2021 | 148950 | |||
20-10-2021 | -155374.15 | |||
13-10-2021 | 155513 | |||
25-10-2021 | -99440.14 | |||
18-10-2021 | 99529 | |||
25-10-2021 | -166459.24 | |||
18-10-2021 | 166608 | |||
25-10-2021 | -102597.31 | |||
18-10-2021 | 102689 | |||
25-10-2021 | -138842.92 | |||
18-10-2021 | 138967 | |||
25-10-2021 | -146134.72 | |||
18-10-2021 | 146281 | |||
27-10-2021 | -131258.7 | |||
20-10-2021 | 131376 | |||
27-10-2021 | -130762.14 | |||
20-10-2021 | 130879 | |||
27-10-2021 | -75018.96 | |||
20-10-2021 | 75086 | |||
27-10-2021 | -45141.81 | |||
20-10-2021 | 45187 | |||
29-10-2021 | -158252.58 | |||
22-10-2021 | 158396 | |||
29-10-2021 | -176340.41 | |||
22-10-2021 | 176498 | |||
29-10-2021 | -14583.97 | |||
22-10-2021 | 14597 | |||
29-10-2021 | -32748.22 | |||
22-10-2021 | 32781 | |||
25-10-2021 | 180148 | |||
31-10-2021 | -3605345.94 | |||
31-10-2021 | 3577612.43 | |||
31-10-2021 | 24518.94 | |||
25-10-2021 | 95548 | |||
25-10-2021 | 116893 | |||
25-10-2021 | 182577 | |||
26-10-2021 | 281997 | |||
27-10-2021 | 133627 | |||
27-10-2021 | 120197 | |||
27-10-2021 | 151009 | |||
27-10-2021 | 99529 | |||
27-10-2021 | 2762 | |||
27-10-2021 | 121188 | |||
27-10-2021 | 172152 | |||
27-10-2021 | 161734 | |||
27-10-2021 | 124411 | |||
27-10-2021 | 156379 | |||
27-10-2021 | 43792 | |||
28-10-2021 | 141123 | |||
28-10-2021 | 127334 | |||
28-10-2021 | 183513 | |||
28-10-2021 | 298586 | |||
28-10-2021 | 281997 | |||
28-10-2021 | 130535 | |||
28-10-2021 | 111337 | |||
28-10-2021 | 88731 | |||
29-10-2021 | 225678 | |||
30-10-2021 | 28198 |
Hi @jhaanand81 ,
Based on your description, you can try this query:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("xZdJduQwCEDvknVKj3k4S17uf42m2rJLsul17/IgX4wG6ufni/GF8CIg/Pr+Infmofj1+33TvIwAE2BgPJWGxQUOkkMHL8gLdBeDYfpXRbyo0nASsJlCE3Ad7AciC1IqIvqfDLioj+yYekzbeMgNdaQ1zDvjcDCyMizCMOZz5AtSmpnMnUBlRRqBT6RUpp0VNNbEnjGumjZMUiAMsCdSmuSGoAzGHNJYKZWGdZ6FqOCAaDwLcWgZEy3XsmOsktZFUwXQtKuefqsNYhcPWooO5CYedORs7QhljqTOjkhrJwJABjeZLk10mUZSYxneeFYqF++i4ar04KbTSmPTL906ICThKmesHVDVzIaoDw3jCn4lSnNGshGVRwwd0CDvFJ+duTMoXDl2bxgUnW/dYkmRGmrSxJJKRyxIu5X082Nanyp5qDeApGSTRkmdKby9L6DUuFpyk2gdYplNcnOIlTuHgqDLXxDONkS7DRaq6s1PEWI1ocyqHcOMaAOkYZiJO6YSkjqsMSNZbXIQq/jFSeky4sgWrkOXs8wcScHco6EaOqOpbGmEuUO4/rKzF3emUiOzeWCvYgT6gJlQ3goZORvoxmjVSwZqw6jqOW/+3b9bdj79uxNoNSbz3NUbUio7J+7OAGnWkMCGqdREa4cjhM6Pfmc40rxjxPA9vzpGjD57arNToy2GPxNaGnZrEXCj66vfGQjPhqlv/j3C7ImUJjortYzks1tXojQx/b31ZpDSmIuK9uYMPo3vjNfE/0zjjXGTcxnujNRr187bkGqNzjMmlxhzLG1Eac4Qt+ETgNKcii82UK7tmfJUsnpdSjSEnzp6J+2kNlNZV1fTtDV/znPk5lltwhnjOn+qu/JzBmzzyqiTvw/iTl43CDQdtHyPq7huQ+oer/UXjdypxlQjrxP8s8LXd67b4uZkLf3GGynptXLXtkAkbuRUvxekkQdf42qVL+feLl9yvw+KahZt5LXbuPn/CJ8zamtfqrPI4/xtspst8e8f", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Document Date" = _t, #"Amount in doc. curr." = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Document Date", type text}, {"Amount in doc. curr.", type number}}),
#"Changed Type with Locale" = Table.TransformColumnTypes(#"Changed Type", {{"Document Date", type date}}, "en-GB"),
#"Added Index" = Table.AddIndexColumn(#"Changed Type with Locale", "Index", 1, 1, Int64.Type),
#"Filtered Rows" = Table.SelectRows(#"Added Index", each [#"Amount in doc. curr."] > 1),
#"Added Index1" = Table.AddIndexColumn(#"Filtered Rows", "Index.1", 1, 1, Int64.Type),
#"Merged Queries" = Table.NestedJoin(#"Added Index", {"Index"}, #"Added Index1", {"Index.1"}, "Added Index1", JoinKind.LeftOuter),
#"Expanded Added Index1" = Table.ExpandTableColumn(#"Merged Queries", "Added Index1", {"Amount in doc. curr."}, {"Added Index1.Amount in doc. curr."}),
#"Renamed Columns" = Table.RenameColumns(#"Expanded Added Index1",{{"Added Index1.Amount in doc. curr.", "Output1"}}),
#"Filtered Rows1" = Table.SelectRows(#"Renamed Columns", each [#"Amount in doc. curr."] < 0),
#"Added Index2" = Table.AddIndexColumn(#"Filtered Rows1", "Index.1", 1, 1, Int64.Type),
#"Merged Queries1" = Table.NestedJoin(#"Renamed Columns", {"Index"}, #"Added Index2", {"Index.1"}, "Added Index2", JoinKind.LeftOuter),
#"Expanded Added Index2" = Table.ExpandTableColumn(#"Merged Queries1", "Added Index2", {"Amount in doc. curr."}, {"Added Index2.Amount in doc. curr."}),
#"Renamed Columns1" = Table.RenameColumns(#"Expanded Added Index2",{{"Added Index2.Amount in doc. curr.", "Ouput2"}}),
BufferedValues = List.Buffer(#"Renamed Columns1"[Output1]),
CumulativeTotal = Table.AddColumn(#"Renamed Columns1", "Output3", each -16197615.03 + List.Sum(List.FirstN(BufferedValues,[Index])),type number),
#"Removed Columns" = Table.RemoveColumns(CumulativeTotal,{"Index"})
in
#"Removed Columns"
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Nathaniel,
Thank you for your reply please find the details and let me know if you are able to understand my query.
Yes need to split the single to get the output.
Document Date | Amount in doc. curr. | Subtotal Positive Values(Amount in doc. curr.) more than 1 Output 1 | Total of Value(Amount in doc. curr.) less than 0 Output 2 | Total of Negative Value(-16197615.03+Subtotal of Positive Value) Output 3 |
31-10-2021 | 27733.51 | -6201900.18 | -16169881.52 | |
31-10-2021 | -6201900.18 | -77460.65 | -9992500.28 | |
31-10-2021 | 6177381.24 | -164075.37 | -9896376.28 | |
30-09-2021 | -77460.65 | -164075.37 | -9732154.28 | |
23-09-2021 | 96124 | -164075.37 | -9567932.28 | |
01-10-2021 | -164075.37 | -107457.97 | -9403710.28 | |
24-09-2021 | 164222 | -127615.96 | -9296156.28 | |
01-10-2021 | -164075.37 | -34430.54 | -9168426.28 | |
24-09-2021 | 164222 | -153512.81 | -9133961.28 | |
01-10-2021 | -164075.37 | -163591.81 | -8980311.28 | |
24-09-2021 | 164222 | -92810.06 | -8816573.28 | |
01-10-2021 | -107457.97 | -298319.41 | -8723680.28 | |
24-09-2021 | 107554 | -184541.08 | -8425094.28 | |
01-10-2021 | -127615.96 | -164510.98 | -8240388.28 | |
24-09-2021 | 127730 | -127596.97 | -8075730.28 | |
04-10-2021 | -34430.54 | -216945.13 | -7948019.28 | |
27-09-2021 | 34465 | -124299.92 | -7730880.28 | |
04-10-2021 | -153512.81 | -88004.36 | -7606469.28 | |
27-09-2021 | 153650 | -125634.73 | -7518386.28 | |
04-10-2021 | -163591.81 | -23637.34 | -7392639.28 | |
27-09-2021 | 163738 | -98490.41 | -7368978.28 | |
04-10-2021 | -92810.06 | -64018.92 | -7270389.28 | |
27-09-2021 | 92893 | -171185.02 | -7206306.28 | |
04-10-2021 | -298319.41 | -114399.77 | -7034968.28 | |
27-09-2021 | 298586 | -99440.14 | -6920466.28 | |
04-10-2021 | -184541.08 | -119750 | -6820937.28 | |
27-09-2021 | 184706 | -49491 | -6701080.28 | |
04-10-2021 | -164510.98 | -140522 | -6651539.28 | |
27-09-2021 | 164658 | -113436 | -6510891.28 | |
04-10-2021 | -127596.97 | -82038 | -6397354.28 | |
27-09-2021 | 127711 | -153218.08 | -6315243.28 | |
04-10-2021 | -216945.13 | -133116.04 | -6161888.28 | |
27-09-2021 | 217139 | -49595.68 | -6028653.28 | |
04-10-2021 | -124299.92 | -392974.82 | -5979013.28 | |
27-09-2021 | 124411 | -152298.9 | -5585687.28 | |
04-10-2021 | -88004.36 | -132026.02 | -5433254.28 | |
27-09-2021 | 88083 | -148817.01 | -5301110.28 | |
04-10-2021 | -125634.73 | -155374.15 | -5152160.28 | |
27-09-2021 | 125747 | -99440.14 | -4996647.28 | |
04-10-2021 | -23637.34 | -166459.24 | -4897118.28 | |
27-09-2021 | 23661 | -102597.31 | -4730510.28 | |
05-10-2021 | -98490.41 | -138842.92 | -4627821.28 | |
28-09-2021 | 98589 | -146134.72 | -4488854.28 | |
05-10-2021 | -64018.92 | -131258.7 | -4342573.28 | |
28-09-2021 | 64083 | -130762.14 | -4211197.28 | |
05-10-2021 | -171185.02 | -75018.96 | -4080318.28 | |
28-09-2021 | 171338 | -45141.81 | -4005232.28 | |
05-10-2021 | -114399.77 | -158252.58 | -3960045.28 | |
28-09-2021 | 114502 | -176340.41 | -3801649.28 | |
05-10-2021 | -99440.14 | -14583.97 | -3625151.28 | |
28-09-2021 | 99529 | -32748.22 | -3610554.28 | |
12-10-2021 | -119750 | -3605345.94 | -3577773.28 | |
05-10-2021 | 119857 | -3397625.28 | ||
12-10-2021 | -49491 | 179987.15 | ||
05-10-2021 | 49541 | |||
12-10-2021 | -140522 | |||
05-10-2021 | 140648 | |||
12-10-2021 | -113436 | |||
05-10-2021 | 113537 | |||
12-10-2021 | -82038 | |||
05-10-2021 | 82111 | |||
16-10-2021 | -153218.08 | |||
08-10-2021 | 153355 | |||
16-10-2021 | -133116.04 | |||
08-10-2021 | 133235 | |||
16-10-2021 | -49595.68 | |||
08-10-2021 | 49640 | |||
18-10-2021 | -392974.82 | |||
11-10-2021 | 393326 | |||
19-10-2021 | -152298.9 | |||
12-10-2021 | 152433 | |||
19-10-2021 | -132026.02 | |||
12-10-2021 | 132144 | |||
20-10-2021 | -148817.01 | |||
13-10-2021 | 148950 | |||
20-10-2021 | -155374.15 | |||
13-10-2021 | 155513 | |||
25-10-2021 | -99440.14 | |||
18-10-2021 | 99529 | |||
25-10-2021 | -166459.24 | |||
18-10-2021 | 166608 | |||
25-10-2021 | -102597.31 | |||
18-10-2021 | 102689 | |||
25-10-2021 | -138842.92 | |||
18-10-2021 | 138967 | |||
25-10-2021 | -146134.72 | |||
18-10-2021 | 146281 | |||
27-10-2021 | -131258.7 | |||
20-10-2021 | 131376 | |||
27-10-2021 | -130762.14 | |||
20-10-2021 | 130879 | |||
27-10-2021 | -75018.96 | |||
20-10-2021 | 75086 | |||
27-10-2021 | -45141.81 | |||
20-10-2021 | 45187 | |||
29-10-2021 | -158252.58 | |||
22-10-2021 | 158396 | |||
29-10-2021 | -176340.41 | |||
22-10-2021 | 176498 | |||
29-10-2021 | -14583.97 | |||
22-10-2021 | 14597 | |||
29-10-2021 | -32748.22 | |||
22-10-2021 | 32781 | |||
25-10-2021 | 180148 | |||
31-10-2021 | -3605345.94 | |||
31-10-2021 | 3577612.43 | |||
31-10-2021 | 24518.94 | |||
25-10-2021 | 95548 | |||
25-10-2021 | 116893 | |||
25-10-2021 | 182577 | |||
26-10-2021 | 281997 | |||
27-10-2021 | 133627 | |||
27-10-2021 | 120197 | |||
27-10-2021 | 151009 | |||
27-10-2021 | 99529 | |||
27-10-2021 | 2762 | |||
27-10-2021 | 121188 | |||
27-10-2021 | 172152 | |||
27-10-2021 | 161734 | |||
27-10-2021 | 124411 | |||
27-10-2021 | 156379 | |||
27-10-2021 | 43792 | |||
28-10-2021 | 141123 | |||
28-10-2021 | 127334 | |||
28-10-2021 | 183513 | |||
28-10-2021 | 298586 | |||
28-10-2021 | 281997 | |||
28-10-2021 | 130535 | |||
28-10-2021 | 111337 | |||
28-10-2021 | 88731 | |||
29-10-2021 | 225678 | |||
30-10-2021 | 28198 |
Hi @jhaanand81 ,
Based on your description, you can try this query:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("xZdJduQwCEDvknVKj3k4S17uf42m2rJLsul17/IgX4wG6ufni/GF8CIg/Pr+Infmofj1+33TvIwAE2BgPJWGxQUOkkMHL8gLdBeDYfpXRbyo0nASsJlCE3Ad7AciC1IqIvqfDLioj+yYekzbeMgNdaQ1zDvjcDCyMizCMOZz5AtSmpnMnUBlRRqBT6RUpp0VNNbEnjGumjZMUiAMsCdSmuSGoAzGHNJYKZWGdZ6FqOCAaDwLcWgZEy3XsmOsktZFUwXQtKuefqsNYhcPWooO5CYedORs7QhljqTOjkhrJwJABjeZLk10mUZSYxneeFYqF++i4ar04KbTSmPTL906ICThKmesHVDVzIaoDw3jCn4lSnNGshGVRwwd0CDvFJ+duTMoXDl2bxgUnW/dYkmRGmrSxJJKRyxIu5X082Nanyp5qDeApGSTRkmdKby9L6DUuFpyk2gdYplNcnOIlTuHgqDLXxDONkS7DRaq6s1PEWI1ocyqHcOMaAOkYZiJO6YSkjqsMSNZbXIQq/jFSeky4sgWrkOXs8wcScHco6EaOqOpbGmEuUO4/rKzF3emUiOzeWCvYgT6gJlQ3goZORvoxmjVSwZqw6jqOW/+3b9bdj79uxNoNSbz3NUbUio7J+7OAGnWkMCGqdREa4cjhM6Pfmc40rxjxPA9vzpGjD57arNToy2GPxNaGnZrEXCj66vfGQjPhqlv/j3C7ImUJjortYzks1tXojQx/b31ZpDSmIuK9uYMPo3vjNfE/0zjjXGTcxnujNRr187bkGqNzjMmlxhzLG1Eac4Qt+ETgNKcii82UK7tmfJUsnpdSjSEnzp6J+2kNlNZV1fTtDV/znPk5lltwhnjOn+qu/JzBmzzyqiTvw/iTl43CDQdtHyPq7huQ+oer/UXjdypxlQjrxP8s8LXd67b4uZkLf3GGynptXLXtkAkbuRUvxekkQdf42qVL+feLl9yvw+KahZt5LXbuPn/CJ8zamtfqrPI4/xtspst8e8f", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Document Date" = _t, #"Amount in doc. curr." = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Document Date", type text}, {"Amount in doc. curr.", type number}}),
#"Changed Type with Locale" = Table.TransformColumnTypes(#"Changed Type", {{"Document Date", type date}}, "en-GB"),
#"Added Index" = Table.AddIndexColumn(#"Changed Type with Locale", "Index", 1, 1, Int64.Type),
#"Filtered Rows" = Table.SelectRows(#"Added Index", each [#"Amount in doc. curr."] > 1),
#"Added Index1" = Table.AddIndexColumn(#"Filtered Rows", "Index.1", 1, 1, Int64.Type),
#"Merged Queries" = Table.NestedJoin(#"Added Index", {"Index"}, #"Added Index1", {"Index.1"}, "Added Index1", JoinKind.LeftOuter),
#"Expanded Added Index1" = Table.ExpandTableColumn(#"Merged Queries", "Added Index1", {"Amount in doc. curr."}, {"Added Index1.Amount in doc. curr."}),
#"Renamed Columns" = Table.RenameColumns(#"Expanded Added Index1",{{"Added Index1.Amount in doc. curr.", "Output1"}}),
#"Filtered Rows1" = Table.SelectRows(#"Renamed Columns", each [#"Amount in doc. curr."] < 0),
#"Added Index2" = Table.AddIndexColumn(#"Filtered Rows1", "Index.1", 1, 1, Int64.Type),
#"Merged Queries1" = Table.NestedJoin(#"Renamed Columns", {"Index"}, #"Added Index2", {"Index.1"}, "Added Index2", JoinKind.LeftOuter),
#"Expanded Added Index2" = Table.ExpandTableColumn(#"Merged Queries1", "Added Index2", {"Amount in doc. curr."}, {"Added Index2.Amount in doc. curr."}),
#"Renamed Columns1" = Table.RenameColumns(#"Expanded Added Index2",{{"Added Index2.Amount in doc. curr.", "Ouput2"}}),
BufferedValues = List.Buffer(#"Renamed Columns1"[Output1]),
CumulativeTotal = Table.AddColumn(#"Renamed Columns1", "Output3", each -16197615.03 + List.Sum(List.FirstN(BufferedValues,[Index])),type number),
#"Removed Columns" = Table.RemoveColumns(CumulativeTotal,{"Index"})
in
#"Removed Columns"
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Yingil,
Please help with the same output 1,2,3 with the below data set:
Account | Document Number | Document Date | Amount in doc. curr. |
IN00001950 | 6500173166 | 08-09-2021 | 11,79,677.00 |
IN00001950 | 6500173814 | 08-09-2021 | 2,56,564.00 |
IN00001950 | 6500174906 | 10-09-2021 | 13,35,889.00 |
IN00001950 | 6500176160 | 12-09-2021 | 11,17,600.00 |
IN00001950 | 6500176195 | 10-09-2021 | 12,51,291.00 |
IN00001950 | 6500176772 | 12-09-2021 | 67,517.00 |
IN00001950 | 6500176784 | 13-09-2021 | 10,01,480.00 |
IN00001950 | 6500176785 | 13-09-2021 | 5,03,902.00 |
IN00001950 | 6500176978 | 14-09-2021 | 15,93,720.00 |
IN00001950 | 6500177902 | 15-09-2021 | 4,45,705.00 |
IN00001950 | 6500177908 | 15-09-2021 | 11,13,140.00 |
IN00001950 | 6500178867 | 16-09-2021 | 19,30,226.00 |
IN00001950 | 6500179503 | 16-09-2021 | 41,517.00 |
IN00001950 | 6500181239 | 18-09-2021 | 15,77,427.00 |
IN00001950 | 6500181240 | 18-09-2021 | 14,67,081.00 |
IN00001950 | 6500181241 | 18-09-2021 | 10,14,993.00 |
IN00001950 | 6500181242 | 18-09-2021 | 4,21,663.00 |
IN00001950 | 6500182264 | 20-09-2021 | 14,32,321.00 |
IN00001950 | 6500182265 | 20-09-2021 | 12,89,969.00 |
IN00001950 | 6500182337 | 21-09-2021 | 15,35,120.00 |
IN00001950 | 6500182434 | 21-09-2021 | 9,96,713.00 |
IN00001950 | 6500182435 | 21-09-2021 | 8,14,891.00 |
IN00001950 | 6500183138 | 21-09-2021 | 2,31,638.00 |
IN00001950 | 6500183139 | 21-09-2021 | 43,247.00 |
IN00001950 | 6500192792 | 04-10-2021 | 7,65,191.00 |
IN00001950 | 6500192793 | 04-10-2021 | 7,39,727.00 |
IN00001950 | 6500192817 | 05-10-2021 | 10,75,197.00 |
IN00001950 | 6500192843 | 05-10-2021 | 16,16,259.00 |
IN00001950 | 6500193473 | 05-10-2021 | 13,92,459.00 |
IN00001950 | 6500193702 | 06-10-2021 | 14,88,516.00 |
IN00001950 | 6500194337 | 06-10-2021 | 17,15,166.00 |
IN00001950 | 6500194338 | 06-10-2021 | 55,589.00 |
IN00001950 | 6500195954 | 09-10-2021 | 8,50,445.00 |
IN00001950 | 6500195955 | 09-10-2021 | 1,60,135.00 |
IN00001950 | 6500195964 | 09-10-2021 | 5,39,357.00 |
IN00001950 | 6500196333 | 09-10-2021 | 2,925.00 |
IN00001950 | 6500196344 | 09-10-2021 | 9,87,324.00 |
IN00001950 | 6500196484 | 09-10-2021 | 18,55,928.00 |
IN00001950 | 6500197049 | 10-10-2021 | 15,46,766.00 |
IN00001950 | 6500198016 | 11-10-2021 | 9,03,227.00 |
IN00001950 | 6500198243 | 12-10-2021 | 17,39,031.00 |
IN00001950 | 6500198244 | 12-10-2021 | 13,31,305.00 |
IN00001950 | 6500198662 | 12-10-2021 | 1,98,500.00 |
IN00001950 | 6500199274 | 12-10-2021 | 10,802.00 |
IN00001950 | 6500199529 | 14-10-2021 | 9,82,355.00 |
IN00001950 | 6500199596 | 14-10-2021 | 4,00,099.00 |
IN00001950 | 6500200988 | 16-10-2021 | 2,79,669.00 |
IN00001950 | 6500200993 | 16-10-2021 | 17,26,621.00 |
IN00001950 | 6500200994 | 16-10-2021 | 10,42,559.00 |
IN00001950 | 6500201380 | 18-10-2021 | 57,017.00 |
IN00001950 | 6500204502 | 18-10-2021 | 21,07,730.00 |
IN00001950 | 6500206547 | 22-10-2021 | 14,14,677.00 |
IN00001950 | 6500206548 | 22-10-2021 | 1,66,489.00 |
IN00001950 | 6500206909 | 23-10-2021 | 12,91,987.00 |
IN00001950 | 6500207318 | 23-10-2021 | 20,12,481.00 |
IN00001950 | 6500210906 | 27-10-2021 | 16,60,816.00 |
IN00001950 | 6500211431 | 28-10-2021 | 10,92,960.00 |
IN00001950 | 6500211432 | 28-10-2021 | 3,70,286.00 |
IN00001950 | 6500211434 | 28-10-2021 | 2,30,072.00 |
IN00001950 | 6500211679 | 28-10-2021 | 4,25,172.00 |
IN00001950 | 6500211696 | 28-10-2021 | 12,36,244.00 |
IN00001950 | 6500214044 | 01-11-2021 | 10,44,343.00 |
IN00001950 | 6500214057 | 02-11-2021 | 12,91,322.00 |
IN00001950 | 6500214088 | 02-11-2021 | 12,93,276.00 |
IN00001950 | 6500214090 | 02-11-2021 | 16,97,788.00 |
IN00001950 | 6500214091 | 02-11-2021 | 2,03,648.00 |
IN00001950 | 6500214327 | 02-11-2021 | 12,81,387.00 |
IN00001950 | 6500215048 | 04-11-2021 | 5,56,639.00 |
IN00001950 | 6500215049 | 04-11-2021 | 8,36,231.00 |
IN00001950 | 6500215052 | 05-11-2021 | 11,97,991.00 |
IN00001950 | 6500217313 | 08-11-2021 | 13,95,994.00 |
IN00001950 | 6500217556 | 09-11-2021 | 19,29,327.00 |
IN00001950 | 6500217557 | 09-11-2021 | 1,70,463.00 |
IN00001950 | 6500218085 | 09-11-2021 | 9,90,247.00 |
IN00001950 | 6500218086 | 09-11-2021 | 10,50,344.00 |
IN00001950 | 6500218087 | 09-11-2021 | 4,81,837.00 |
IN00001950 | 6500218122 | 09-11-2021 | 1,45,516.00 |
IN00001950 | 6500218628 | 10-11-2021 | 2,59,479.00 |
IN00001950 | 6500219317 | 11-11-2021 | 18,07,971.00 |
IN00001950 | 6500219343 | 11-11-2021 | 13,30,086.00 |
IN00001950 | 6500219581 | 10-11-2021 | 13,54,193.00 |
IN00001950 | 6500220267 | 11-11-2021 | 11,48,745.00 |
IN00001950 | 6500220268 | 11-11-2021 | 4,08,187.00 |
IN00001950 | 6500221404 | 13-11-2021 | 14,12,799.00 |
IN00001950 | 6500221405 | 13-11-2021 | 3,58,445.00 |
IN00001950 | 6500221809 | 13-11-2021 | 12,80,376.00 |
IN00001950 | 6500222254 | 13-11-2021 | 12,09,988.00 |
IN00001950 | 6500222255 | 13-11-2021 | 15,45,646.00 |
IN00001950 | 6500222256 | 13-11-2021 | 4,17,431.00 |
IN00001950 | 6500222489 | 14-11-2021 | 2,92,452.00 |
IN00001950 | 6500222524 | 14-11-2021 | 13,16,386.00 |
IN00001950 | 6500223502 | 15-11-2021 | 15,15,663.00 |
IN00001950 | 6500223503 | 15-11-2021 | 6,35,743.00 |
IN00001950 | 6500223685 | 16-11-2021 | 15,73,653.00 |
IN00001950 | 6500223798 | 16-11-2021 | 17,15,579.00 |
IN00001950 | 6500224626 | 17-11-2021 | 11,44,859.00 |
IN00001950 | 6500224644 | 17-11-2021 | 11,13,279.00 |
IN00001950 | 6500225638 | 18-11-2021 | 14,29,688.00 |
IN00001950 | 6500225645 | 18-11-2021 | 12,77,593.00 |
IN00001950 | 6500225646 | 18-11-2021 | 2,05,551.00 |
IN00001950 | 6500225647 | 18-11-2021 | 17,966.00 |
IN00001950 | 6500225754 | 18-11-2021 | 14,31,088.00 |
IN00001950 | 6500227794 | 19-11-2021 | 13,92,590.00 |
IN00001950 | 6500227800 | 19-11-2021 | 14,49,994.00 |
IN00001950 | 6500228995 | 21-11-2021 | 8,35,413.00 |
IN00001950 | 6500228998 | 21-11-2021 | 8,87,775.00 |
IN00001950 | 6500228999 | 21-11-2021 | 2,22,172.00 |
IN00001950 | 6500229077 | 20-11-2021 | 17,41,122.00 |
IN00001950 | 6500230500 | 23-11-2021 | 13,70,348.00 |
IN00001950 | 6500230516 | 23-11-2021 | 10,36,759.00 |
IN00001950 | 6500233600 | 25-11-2021 | 7,09,524.00 |
IN00001950 | 6500233605 | 25-11-2021 | 6,32,756.00 |
IN00001950 | 6500237963 | 30-11-2021 | 15,42,508.00 |
IN00001950 | 4300155546 | 01-10-2021 | -14,34,958.00 |
IN00001950 | 4300155766 | 13-10-2021 | -36,18,261.00 |
IN00001950 | 4300169870 | 15-11-2021 | -48,81,276.00 |
IN00001950 | 4300155552 | 11-10-2021 | -30,11,346.00 |
IN00001950 | 4300155550 | 08-10-2021 | -19,69,982.00 |
IN00001950 | 4300168942 | 01-11-2021 | -59,37,358.00 |
IN00001950 | 4300155547 | 04-10-2021 | -37,68,928.00 |
IN00001950 | 4300169135 | 08-11-2021 | -30,46,125.00 |
IN00001950 | 1100007842 | 30-09-2021 | -2,18,491.98 |
IN00001950 | 4300172830 | 19-11-2021 | -33,51,701.00 |
IN00001950 | 4300165011 | 26-10-2021 | -15,03,495.00 |
IN00001950 | 4300155548 | 05-10-2021 | -15,03,984.00 |
IN00001950 | 4300155570 | 12-10-2021 | -27,19,860.00 |
IN00001950 | 4300169233 | 09-11-2021 | -21,62,810.00 |
IN00001950 | 4300168946 | 05-11-2021 | -13,81,218.00 |
IN00001950 | 4300168943 | 02-11-2021 | -41,79,131.00 |
IN00001950 | 4300165018 | 27-10-2021 | -40,80,272.00 |
IN00001950 | 4300165003 | 20-10-2021 | -14,65,771.00 |
IN00001950 | 4300170479 | 17-11-2021 | -16,59,332.00 |
IN00001950 | 4300165027 | 28-10-2021 | -32,56,360.00 |
IN00001950 | 4300155549 | 07-10-2021 | -31,49,751.00 |
IN00001950 | 5,34,24,123.02 | ||
IN00001950 | 5,34,24,123.02 | ||
IN00004576 | 6500195981 | 08-10-2021 | 68,449.00 |
IN00004576 | 6500196762 | 08-10-2021 | 18,139.00 |
IN00004576 | 6500200548 | 16-10-2021 | 46,610.00 |
IN00004576 | 6500201158 | 16-10-2021 | 57,550.00 |
IN00004576 | 6500211473 | 28-10-2021 | 20,056.00 |
IN00004576 | 6500211867 | 28-10-2021 | 82,108.00 |
IN00004576 | 6500212098 | 29-10-2021 | 11,211.00 |
IN00004576 | 6500218903 | 10-11-2021 | 24,141.00 |
IN00004576 | 6500219371 | 10-11-2021 | 65,128.00 |
IN00004576 | 6500233091 | 25-11-2021 | 77,779.00 |
IN00004576 | 6500233092 | 25-11-2021 | 23,946.00 |
IN00004576 | 4300161155 | 26-10-2021 | -1,00,000.00 |
IN00004576 | 4300172920 | 20-11-2021 | -1,00,000.00 |
IN00004576 | 4300155897 | 16-10-2021 | -1,00,000.00 |
IN00004576 | 4300169422 | 10-11-2021 | -1,00,000.00 |
IN00004576 | 4300154887 | 07-10-2021 | -1,00,000.00 |
IN00004576 | 1000082200 | 30-09-2021 | 422.00 |
IN00004576 | 1100008077 | 30-09-2021 | -7,416.00 |
IN00004576 | -11,877.00 | ||
IN00004576 | -11,877.00 | ||
5,34,12,246.02 |
Hi @jhaanand81 , did you mean a single column? Would you provide us with expected outcome? Thank you!
If you would share your pbix, or dummy up some values in Excel both for current and expected data. Please copy and paste them into your post, rather than doing a picture, we may be able to help you.
Please read this post to get your question answered more quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Nathaniel
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.