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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
WSeirafi
Helper I
Helper I

Top selling country per supplier overall

Hello,

 

I have this measure which is working very well

Strategic Partner Top Country =

VAR vals =
    SUMMARIZE (

        Invoices,

        Geography[COUNTRY_NAME],

        Suppliers[Sup_Id],


        "Spend per country", [Spend YTD]

    )

VAR MaxSpend =

    MAXX ( vals, [Spend per country] )

VAR TopCountry =

    CALCULATE (

        MAXX (

            FILTER ( vals, [Spend per country] = MaxSpend ),

            Geography[COUNTRY_NAME]

        )
    )

RETURN

    TopCountry
 
This shows the top selling country, however if I filter on a region, it will show the top selling country of that region. I need it to ignore the slicer, however couldn't make it work with REMOVEFILTERS and ALL functions.
 
Any idea ?

Thanks for your help
2 REPLIES 2
bhanu_gautam
Super User
Super User

@WSeirafi , Try using below method

 

Strategic Partner Top Country =
VAR vals =
SUMMARIZE (
REMOVEFILTERS(ALL(Geography[COUNTRY_NAME])),
Geography[COUNTRY_NAME],
Suppliers[Sup_Id],
"Spend per country", [Spend YTD]
)
VAR MaxSpend =
MAXX ( vals, [Spend per country] )
VAR TopCountry =
CALCULATE (
MAXX (
FILTER ( vals, [Spend per country] = MaxSpend ),
Geography[COUNTRY_NAME]
)
)
RETURN
TopCountry




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hello,

 

There is a syntax error, parameter is the not the correct type for REMOVEFILTERS(ALL(Geography[COUNTRY_NAME]))

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.