March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I`ve been trying to do a cumulative sum to make a pareto chart. I`ve tried multiple approaches that at first worked fine, but when combined with some filters I start to get some problems. The formula that has given the best results is
Cumulative =
CALCULATE([Spend USD],
TOPN([Ranking Supplier],
ALLSELECTED(f_net_source_saving_invoice[supplier_level_1_parent_name]),
[Spend USD],
DESC))
Ranking Supplier =
RANKX(ALLSELECTED(f_net_source_saving_invoice[supplier_level_1_parent_name]),
[Spend USD], , DESC)
But when using the filters I get the next result
Supplier | Spend Amount | Ranking Supplier | Cumulative | % Accumulated Spend |
A | 317 | 1 | 317 | 0.10 |
B | 235 | 3 | 552 | 0.18 |
C | 214 | 3 | 776 | 0.25 |
D | 226 | 4 | 10005 | 0.32 |
E | 200 | 6 | 215 | 0.07 |
F | 181 | 6 | 1496 | 0.48 |
I would apreciate any posible solution someone could come up with
Solved! Go to Solution.
Hi @gabnarmor ,
Based on the information you provided, you can follow these steps:
SORT =
RANKX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[% Accumulated Spend] ),
CALCULATE ( MAX ( 'Table'[% Accumulated Spend] ) ),
,
ASC
)
Cumulative =
CALCULATE (
SUM ( 'Table'[Spend Amount] ),
FILTER (
ALL ( 'Table' ),
'Table'[% Accumulated Spend] <= SELECTEDVALUE ( 'Table'[% Accumulated Spend] )
)
)
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @gabnarmor ,
Based on the information you provided, you can follow these steps:
SORT =
RANKX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[% Accumulated Spend] ),
CALCULATE ( MAX ( 'Table'[% Accumulated Spend] ) ),
,
ASC
)
Cumulative =
CALCULATE (
SUM ( 'Table'[Spend Amount] ),
FILTER (
ALL ( 'Table' ),
'Table'[% Accumulated Spend] <= SELECTEDVALUE ( 'Table'[% Accumulated Spend] )
)
)
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It worked well. Thank you very much.
Hi,
Share some data to work with and show the expected result.
The data I have is the following
Supplier | Spend Amount |
A | 317 |
B | 235 |
C | 214 |
D | 226 |
E | 200 |
F | 181 |
The desairable result would be
Supplier | Spend Amount | % Accumulated Spend | Ranking Supplier | Cumulative |
A | 317 | 0.23 | 1 | 317 |
B | 235 | 0.40 | 2 | 552 |
D | 226 | 0.57 | 3 | 778 |
C | 214 | 0.72 | 4 | 992 |
E | 200 | 0.87 | 5 | 1192 |
F | 181 | 1 | 6 | 1373 |
Please take into account that I am working with a lot of filters that users can choose to use or not. So the issue probably can`t be replicated easily even with the data
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
70 | |
68 |