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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Kudoed Authors