Forum Discussion

Fraukje's avatar
Fraukje
Icon for Advocate II rankAdvocate II
8 years ago

Calculated column IF always returns FALSE

I have the following calculated column, and for some reason it will always return to the FALSE expression (i.e. it always uses the RateToDollar):

 

TransactionAmountConverted = CALCULATE(VALUES(Transactions[TransactionAmount]) * (IF([CurrencyFilter] = "EUR", VALUES('Currency'[RateToEuro]), VALUES('Currency'[RateToDollar]))))

 The CurrencyFilter is a calculated measure that gets a report level filter value:

CurrencyFilter = IF(LASTNONBLANK('CurrencyFormat'[Name], 1) = "USD", "USD", "EUR")

I have tested the CurrencyFilter value and it is a 'text' value that indeed is set to "USD" or "EUR" depending on the report filter. Now I really do not understand why the IF statement in the calculated column always goes to the FALSE part...

 

Anyone has any ideas? Any help is much appreciated!

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Hmm, that's probably a difficult one to troubleshoot, it is most like some kind of context issue.

      • Greg_Deckler's avatar
        Greg_Deckler
        Icon for Community Champion rankCommunity Champion

        Would need some sample/example data or for you to share a link to your PBIX file. Context issues are tricky.