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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.