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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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