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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
Matas
Advocate II
Advocate II

Amount Calculations in Custom Column

Hello,

 

Anyone could help me out with Custom Column calculation?
Currently, I have a calculation as [Gross_Amount] * [Currency Rate to USD] to get the total amount in USD.

 

Matas_0-1650355575222.png

 

[Currency Rate to USD] is being calculated as merging two tables based on the currency identifier, such as: CLP, GBP, EUR, etc.

Matas_2-1650356021357.png

 

 

I just noticed that if I have Chilean Pesso, my calculations are false, since CLP does not contain a decimal value, so the total amount of this currency is being returned 100 times lower. 

 

I would need somehow to check in my calculation if there exists CLP, then if it does, I need to multiply this field by *100, otherwise, leave other currencies the way they are. Anyone has faced that or have any suggestions on how I could achieve that?

Thanks in advance.

 

Regards,

Matas

 

 

1 ACCEPTED SOLUTION
Matas
Advocate II
Advocate II

Hi,

 

So I was able to achieve wanted result by googling and also looking at @amitchandak  example. 

The following solved my issue:

Matas_0-1650366236553.png

 

Regards,

Matas

 

View solution in original post

3 REPLIES 3
Matas
Advocate II
Advocate II

Hi,

 

So I was able to achieve wanted result by googling and also looking at @amitchandak  example. 

The following solved my issue:

Matas_0-1650366236553.png

 

Regards,

Matas

 

amitchandak
Super User
Super User

@Matas ,

a new column in power query

 

if [currency] <> "CLP" then [Gross_amount]*[Currency Rate to USD] else [Gross_amount]*[Currency Rate to USD] /100

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi @amitchandak 

 

Thanks for your input.

Could I ask you to be more detailed? Since I do not have this [currency] field and I am merging fields, so after I have merged, I do not think so I can apply <> "CLP", since it was already merged on that before.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.