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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
DBA1138
Frequent Visitor

DAX measure to switch between 2 measures based on cell value

Hello,

 

I have balances in 2 currencies; CAD and USD. 
I want to convert USD to CAD and achieve the expected result below.

CurrencyTotal Closing BalanceCurrent conversion applied to closingExpected Result
USD$34,490,504.28$42,488,852.22$42,488,852.22
CAD-$26,645,252.30-$32,824,286.31-$26,645,252.30

 

Total Closing Balance = SUM('Cash Balances'[Closing Balance])
 
Current conversion applied to closing =
[Total Closing Balance] * SUM('Current Day Exchange Rate'[Current Exchange Rate])

 

How would I go about this? I've tried using IF() in a calculated column, but I run into a circular dependency error as I already have a another calculated column (ideally, I'll use a measure for that as well). If I try using IF() as a measure instead, I get the following:

DBA1138_0-1620144672926.png

 

I tried making the IF() function work by creating a conditional column in Power Query, then creating the following measure:

Measure =
IF(
SUM('Cash Balances'[True/False (currency conversion)]) > 0,
[Current conversion applied to closing],
[Total Closing Balance]
)

The row values are right in the table visual, but the totals are wrong:

DBA1138_1-1620146109206.png

 

What am I missing? 

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@DBA1138 - In measures, you need to wrap your column references in an aggregator like MAX, MIN, etc.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.