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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous_KH
Frequent Visitor

Sum of Trophies by 2 Particular Country

Greetings all,

 

I'm new to Power BI/Dax in general so apologize if this might seems obvoious but I couldn't manage to find a way to do it.

 

i want DAX FUNCTION to caluclate measure of sum of trophies won by australia and africa combined ,

i want to display it in card visualization.

 

countries trophy.png

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous_KH ,

According to your description, here's my solution. Create a measure.

Measure =
IF (
    "AFRICA"
        IN VALUES ( 'Table'[COUNTRY] )
            || "AUSTRALIA" IN VALUES ( 'Table'[COUNTRY] ),
    SUMX (
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[COUNTRY] IN { "AFRICA", "AUSTRALIA" }
        ),
        'Table'[TROPHIES WON]
    )
)

Get the correct result.

vkalyjmsft_0-1663132894417.png

vkalyjmsft_1-1663132906542.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous_KH ,

According to your description, here's my solution. Create a measure.

Measure =
IF (
    "AFRICA"
        IN VALUES ( 'Table'[COUNTRY] )
            || "AUSTRALIA" IN VALUES ( 'Table'[COUNTRY] ),
    SUMX (
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[COUNTRY] IN { "AFRICA", "AUSTRALIA" }
        ),
        'Table'[TROPHIES WON]
    )
)

Get the correct result.

vkalyjmsft_0-1663132894417.png

vkalyjmsft_1-1663132906542.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

Write this measure

Measure1 = calculate(sum(Data[Trophies won]),Data[Country]="Australia"||Date[Country]="Africa")

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ddpl
Solution Sage
Solution Sage

@Anonymous_KH , Create a measure like below and put it in a card, You'll get your result...

 

Trophies Total= CALCULATESUM('Table'[TROPHIES WON]), 'Table'[COUNTRY] in {"AUSTRALIA""AFRICA"} )

i want to return a measure that ignoring any filters that might have been applied. for example if i click other country in my slicer panel , thic measure automatically showing blank

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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