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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Only sum column if values in another column are unique

I'm sure this one is simple but I still can't figure it out. I have a situation where I want to show totals in a column of a table visual ONLY if the values in another column are unique. In this case, we have a local currency column, and a US currency column. If we have more than one type of local currency in our table, then it makes no sense to show a total, since the numbers aren't on the same scale. The USD column would always have a total, since that is always on the same scale. So in example 1, there's no total for Local Amt, but there is in Example 2, because all local currencies are Brazil. This would obviously need to be responsive to any filters applied to the visual.

 

In essence I need to say "if sum of count of distinct values in currency column = 1 then sum(local amt), else blank" but I can't figure out the DAX to do this.

 

usd example.PNG

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

@Anonymous 

 

You may use the measure below.

Measure =
IF (
    HASONEVALUE ( 'Table'[Currency] ),
    CALCULATE ( SUM ( 'Table'[Local Amt] ) )
)
Community Support Team _ Sam Zha
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

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Anonymous 

 

You may use the measure below.

Measure =
IF (
    HASONEVALUE ( 'Table'[Currency] ),
    CALCULATE ( SUM ( 'Table'[Local Amt] ) )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-chuncz-msft  That worked like a charm, thank you!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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