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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
crissins
Frequent Visitor

Calculate currency in different column while ignoring USD

Hello,

 

I am trying to calculate KSH & STG to USD. The rate table looks like this.

crissins_0-1657064854729.png

and my main Sales data 

crissins_1-1657064953611.png

I am concatenating the year and week as a string in both tables to match them but. I am getting empty values in the merge columns with the when exchange rates

crissins_2-1657065148003.png

my formula to calculate the gross price in dollars is the following.

= Table.AddColumn(#"Rounded Off", "Gross_USD", each if [CURRENCY] = "KSH" then [GROSS_PRICE] / [Rates.KSH_PER_USD]
else if [CURRENCY] = "STG" then ([Rates.USD_PER_STG] * [GROSS_PRICE])
else [GROSS_PRICE])

Thank you very much for taking the time in reading this post this is for a sales report and is my first as a freelancer.

Regards, 

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

The Query Editor is case sensitive.  In the cells where you get null, ensure that in the Currency column, the entry is KSH and STG.  If it still does not help, then share the link from where i can download your PBI file.  If the data was imported from an MS Excel file, then share the download link of that Excel file as well.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
crissins
Frequent Visitor

Here's my relations

crissins_0-1657065385854.png

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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