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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Dimitris_Kats
Resolver I
Resolver I

Fixed Exchange Rate

Hello Everyone,

 

I have a small problem...i can think of a solution but I am not sure if its the best one so I will need your advice about that.

 

I have a table with sales, cost and profit per country and city for 2021.

I also have another table with fixed exchange rate. This rate won't change throughout the year it will stay stable.
I would like to have both options for my reports. Local Currency and euro.

 

The sales table is:

YearCountryCitySales (Local Currency)Cost (Local Currency)Profit (Local Currency)
2021UKLondon                        100.000                          33.333                            66.667  
2021UKBristol                       150.000                          50.000                          100.000  
2021UKLiverpool                         50.000                          16.667                            33.333  
2021FranceParis                       300.000                        100.000                          200.000  
2021FranceMarseille                         60.000                          20.000                            40.000  
2021FranceLyon                         45.000                          15.000                            30.000  
2021USANY                   1.000.000                        333.333                          666.667  
2021USAArizona                        600.000                        200.000                          400.000  
2021IndiaNew Delhi                 10.000.000                    3.333.333                      6.666.667  
2021IndiaMumbai                   8.500.000                    2.833.333                      5.666.667  

 

The Exchange Rate table is:

Country    Exchange Rate
India85,00000
UK1,19000
France1,00000
USA1,11000

 

I was thinking to use a lookupvalue dax and add a calculated column in my sales table with the exchange rate column and create new columns for sales, cost and profit in euro. 

I was wondering if I can achieve the same results with measures and avoid creating so mane calculated columns.
Thank you very much in advance!!!

1 ACCEPTED SOLUTION

Hi,

I tried to create it in the next page in the attached pbix file.

please check the below picture and the attached pbix file.

 

Picture4.png

 

Sales currency slicer: =
SWITCH (
    SELECTEDVALUE ( 'Currency Select'[Currency select] ),
    "Local", IF ( HASONEVALUE ( Sales[Country] ), SUM ( Sales[Sales (Local Currency)] ) ),
    "Euro",
        SUMX (
            sales,
            CALCULATE (
                DIVIDE (
                    SUM ( Sales[Sales (Local Currency)] ),
                    LOOKUPVALUE (
                        ExchangeRate[Exchange Rate],
                        ExchangeRate[Country], SELECTEDVALUE ( Sales[Country] )
                    )
                )
            )
        )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

I only created the sales amount, and I hope you can apply the same logic to Cost and Profit as well.

Picture2.png

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


First of all thank you very much for your reply! I appreciate it!!

To be honest i wanted to have only 2 selections on the currency slicer : Local and euro.
If they select local currency they will see the sales exactly in the way I have them in the sales table. If they select euro they will have the sales in euro based on the exchange rates on the second table.
Do you think this is possible?

Thank you very much again for your time and help!

Hi,

I tried to create it in the next page in the attached pbix file.

please check the below picture and the attached pbix file.

 

Picture4.png

 

Sales currency slicer: =
SWITCH (
    SELECTEDVALUE ( 'Currency Select'[Currency select] ),
    "Local", IF ( HASONEVALUE ( Sales[Country] ), SUM ( Sales[Sales (Local Currency)] ) ),
    "Euro",
        SUMX (
            sales,
            CALCULATE (
                DIVIDE (
                    SUM ( Sales[Sales (Local Currency)] ),
                    LOOKUPVALUE (
                        ExchangeRate[Exchange Rate],
                        ExchangeRate[Country], SELECTEDVALUE ( Sales[Country] )
                    )
                )
            )
        )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


That's amazing and exactly what i need! 
Thank you so much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors