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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
hazey74
Regular Visitor

trying to convert USD in CA for a stock portfolio

Good day powerbi users. i am trying a simple dax formula. i have a list of US and CA stocks in a simple table format.  i have an expression  i created with some powerbi forum reading and research.  i am not a programmer.

 
pb test = sumx('invest_balance1', 'invest_balance1'[Market Value] * if('invest_balance1'[Market] ="CA", 1, [Exchange rate normalized]*[Market Value])).  the US stocks don't calculate correct.
hazey74_0-1703602130588.png

the left column is correct, because in my exch table i have manually entered  exch CA 1:1, and US is the actual daily rates.

the expression i used is :

PB Currency Adj = sumx('invest_balance1', 'invest_balance1'[Market Value] * [Exchange rate normalized])
hazey74_1-1703602298010.png

 my goal is to eliminate the manual entry of CA 1:1 i have in exch table.

any help is appreciated.

thx

 
1 ACCEPTED SOLUTION
hazey74
Regular Visitor

i may have got it . thx to AJ1973 and ERB help.  this is what i came up with.

 

PB Currency Adj =
        sumx(
            invest_balance1,
            invest_balance1[Market Value]
            * if(
                invest_balance1[Market] = "US",
                [Exchange rate normalized],
                1)
    )

View solution in original post

12 REPLIES 12
hazey74
Regular Visitor

i may have got it . thx to AJ1973 and ERB help.  this is what i came up with.

 

PB Currency Adj =
        sumx(
            invest_balance1,
            invest_balance1[Market Value]
            * if(
                invest_balance1[Market] = "US",
                [Exchange rate normalized],
                1)
    )
hazey74
Regular Visitor

hello, Amine, you want me to upload my actual pbix file, its about 3 mb, not that big.  thx

aj1973
Community Champion
Community Champion

Sorry the sample you sent me doesn't help.

Please I need a sample with 

Exchange_Rate_Table

'invest_balance1', 'invest_balance1'[Market Value] and Its primary Key 
These 2 fields where ever they come from and the primary key if they come from another table
aj1973_0-1703632771966.png

Delete all the rest from sample and give what do you need to see as an outcome

Thanks

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

aj1973
Community Champion
Community Champion

It doesn't have to be the same pbix file. A sample out of it is good enough.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

ok,i made a basic file with the exhange table, measures, etc, 

does this forum allow files to be shared?

thx

aj1973
Community Champion
Community Champion

No, you can share it via an online Service like Google Drive, Dropbox...

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Access Denied message.


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

aj73 user was helping, he sent me an email i was able to grant access to file. 

aj1973
Community Champion
Community Champion

Just sent you an access request

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

ERD
Super User
Super User

Hi @hazey74 ,

This article will help you to achieve the result: Currency conversion in Power BI reports.

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

aj1973
Community Champion
Community Champion

Hi @hazey74 

Can you provide a Sample pbix please?

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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