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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Fab117
Helper IV
Helper IV

Evaluates an expression against a list of values and returns one of multiple possible results

Hi,

In my table, I’ve a field with currency used (e.g.: “EUR”, “USD”, “GBP”)

For my reports, I need to convert all figures in “GBP”, meaning that I’ll apply a xrate factor for non “GBP” figures

My approach is to define a measure to determine this xrate factor for each line of my table.

To prevent use of multiple “IF”, I found that function “Switch” could do the job (link).

However, when I try to define my new measure, I’ve an error message.

 

Power BI error message.png

 

NB: My database name is “layout” and my field name containing the currency is “Currency_1”

Would someone know what is wrong?

 

Thanks in advance.

 

Fab

1 ACCEPTED SOLUTION

Hello,

use this:

 

if [currency_1] = "GDP" then 1.0 else

if [currency_1] = "EUR" then 0.9 else

if [currency_1] = "XXX" then 1.0 else 2.2

 

 

If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudos

Follow me on Linkedin

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




View solution in original post

7 REPLIES 7
Idrissshatila
Super User
Super User

Hello,

 

Try working it as a calculated column in the data view and it would work.

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Thank you for taking time looking at my issue.

No way to keep it as a measure ?

To say it the opposite way, is it a must to add a column (in Power Query mode) in my table and use this formulae on each line?

 

 

I'm askng this, because, each time that I'll have to update the xrate factor, it seems to be easier to do it only once in the measure.

 

Fab

Hello,

 

you could do it in Power query as well.

 

it cant be a measure because the if statement in a measure doesn't take a column but only a measure.

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




I tried to do it in Power Query, adding a custom column.

But faced an issue

Power BI error message2.png

NB: I'm beginner with Power Query requets

 

Fab

I also tested proposal found in Microsoft learning center (link) without success

Power BI error message3.png

Hello,

use this:

 

if [currency_1] = "GDP" then 1.0 else

if [currency_1] = "EUR" then 0.9 else

if [currency_1] = "XXX" then 1.0 else 2.2

 

 

If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudos

Follow me on Linkedin

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




All good with this solution.

 

Thanks

 

Fab

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.