Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
adibhaan98
Frequent Visitor

Pareto Ranking is wrong!

Hello!

I made a pareto to show the distribution of spend for suppliers but when I filter to "Top 20 Suppliers, the pareto and ranking are wrong. How do I fix this? 

Without Filter:

Screenshot (128).png   

With Filter: 

Screenshot (129).png

Here are the formulas I've been using: 

 

Rank = if(HASONEVALUE('Oracle Data'[Supplier]),RANKX(ALL('Oracle Data'[Supplier]),[Total Spend]),BLANK())
Cumulative Invoices = if(HASONEVALUE('Oracle Data'[Supplier]),SUMX(TOPN([Rank],CALCULATETABLE(VALUES('Oracle Data'[Supplier]),ALL('Oracle Data'[Supplier])),[Total Spend]),[Total Spend]),BLANK())
Cumulative Percentage = [Cumulative Invoices]/CALCULATE([Total Spend],ALL('Oracle Data'[Supplier]))
 
Thanks! 
8 REPLIES 8
adibhaan98
Frequent Visitor

Screenshot (130).png

 This is what the ranking and percentages look like

Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi, how would i do that?

Google Drive link.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @adibhaan98 ,

Please have a try.

Rank = 
IF(
    HASONEVALUE('Oracle Data'[Supplier]),
    RANKX(
        ALLSELECTED('Oracle Data'[Supplier]),
        [Total Spend]
    ),
    BLANK()
)
Cumulative Invoices = 
IF(
    HASONEVALUE('Oracle Data'[Supplier]),
    SUMX(
        TOPN(
            [Rank],
            CALCULATETABLE(
                VALUES('Oracle Data'[Supplier]),
                ALLSELECTED('Oracle Data')
            ),
            [Total Spend]
        ),
        [Total Spend]
    ),
    BLANK()
)
Cumulative Percentage = 
[Cumulative Invoices] /
CALCULATE(
    [Total Spend],
    ALLSELECTED('Oracle Data')
)

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

 

 

 

This is the same formula I used.

Anonymous
Not applicable

Hi @adibhaan98 ,

I have changed the formula.

Change All to Allselected.

Rank = 
IF(
    HASONEVALUE('Oracle Data'[Supplier]),
    RANKX(
        ALLSELECTED('Oracle Data'[Supplier]),
        [Total Spend]
    ),
    BLANK()
)

 

Cumulative Invoices = 
IF(
    HASONEVALUE('Oracle Data'[Supplier]),
    SUMX(
        TOPN(
            [Rank],
            CALCULATETABLE(
                VALUES('Oracle Data'[Supplier]),
                ALLSELECTED('Oracle Data')
            ),
            [Total Spend]
        ),
        [Total Spend]
    ),
    BLANK()
)


Based on the formulas you've provided, it seems we need to adjust the context in which the rankings are being calculated when the filter is applied. The issue may be arising because the function is removing all the filters when calculating the rank and cumulative values, which is why your pareto distribution is not accurate after filtering.

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

I tried it and it's  still not working

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.