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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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