cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Frequent Visitor

## Dynamic currency exchange

Hello all,
I am trying to show sales into USD and Pounds.
basically I have Currency exchange table which have from_currency (Euro as base currency) and To_currency (Other currencies) and value.

I have used this formula below and is throwing error,

New Sales conversion =
IF(SELECTEDVALUE(curency_exchange[to_currency_code]) = "USD", FORMAT([Total Sales]* VALUES(curency_exchange[value], "\$0,00",
IF(SELECTEDVALUE(curency_exchange[to_currency_code]) = "GBP", FORMAT([Total Sales]* VALUES(curency_exchange[value]), "\$£0,00"))

Kindly help me out !

1 ACCEPTED SOLUTION
Community Support

``````New Sales conversion =
IF(SELECTEDVALUE(curency_exchange[to_currency_code]) = "USD", FORMAT([Total Sales]* SELECTEDVALUE(curency_exchange[value]), "\$0,00",
IF(SELECTEDVALUE(curency_exchange[to_currency_code]) = "GBP", FORMAT([Total Sales]* SELECTEDVALUE(curency_exchange[value]), "\$£0,00"))``````

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 REPLIES 4
Community Support

``````New Sales conversion =
IF(SELECTEDVALUE(curency_exchange[to_currency_code]) = "USD", FORMAT([Total Sales]* SELECTEDVALUE(curency_exchange[value]), "\$0,00",
IF(SELECTEDVALUE(curency_exchange[to_currency_code]) = "GBP", FORMAT([Total Sales]* SELECTEDVALUE(curency_exchange[value]), "\$£0,00"))``````

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

This is awesome, thanks Li 🙂

Frequent Visitor

Hello,
It is throwing an error. Is there any way to specifically pick the value of selected currency ?

Updating Media

Super User

@analytics-ecoma , try like

New Sales conversion =
Switch(true(),
SELECTEDVALUE(curency_exchange[to_currency_code]) = "USD", FORMAT([Total Sales]* VALUES(curency_exchange[value]), "\$0,00"),
SELECTEDVALUE(curency_exchange[to_currency_code]) = "GBP", FORMAT([Total Sales]* VALUES(curency_exchange[value]), "\$£0,00") )

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors