cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fraukje Regular Visitor
Regular Visitor

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 5
Super User
Super User

Re: Calculated column IF always returns FALSE

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


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Fraukje Regular Visitor
Regular Visitor

Re: Calculated column IF always returns FALSE

Any ideas how to troubleshoot it?

Super User
Super User

Re: Calculated column IF always returns FALSE

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


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Fraukje Regular Visitor
Regular Visitor

Re: Calculated column IF always returns FALSE

Capture.JPGPart of my data modelGraph.JPGSample data

The original transaction amounts can be in any currency available in the Currency table. Based on the user's choice of report filter (currently either USD or EUR), the Transaction Amount should display the transaction's converted amount. So for example, if the user selects 'EUR' in the report filter, the Transaction Amount column should display all original transaction amounts converted to euros. Similarly, if the user would select dollar, for dollars.

 

Oh, and the CurrencyFormat was created for the sole reason to act as a report filter.

Fraukje Regular Visitor
Regular Visitor

Re: Calculated column IF always returns FALSE

Could it be that a calculated column cannot handle dynamicly set values from a report filter? Would you know anything about this?

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 340 members 3,460 guests
Please welcome our newest community members: