The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
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
Solved! Go to 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
Proud to be a 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 👍
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 👍
Proud to be a Super User! | |
I tried to do it in Power Query, adding a custom column.
But faced an issue
NB: I'm beginner with Power Query requets
Fab
I also tested proposal found in Microsoft learning center (link) without success
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
Proud to be a Super User! | |
All good with this solution.
Thanks
Fab