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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
nssidhu74
Frequent Visitor

Dynamic Currency Conversion Incorrect Summary for Measure

I am running into Incorrect Summation problem while converting Currency as show here. 

Also few other problem that i run into.
1)How do i prevent Summary in Exchange Rate Column(It is also displaying incorrect Sum).?
2) Is there a way to Update Header of Column based on the Slicer Value ?
Currency Conversion in Power BI.png

 

Here are the Measure Formulas that i am using.

ExchangeRateForSelectedCurrency = SUMX(Sales, LOOKUPVALUE(ExchangeRate[Rate],
ExchangeRate[CurrencyFrom],SELECTEDVALUE(Sales[UnitOfCurrency])
,ExchangeRate[CurrencyTo],SELECTEDVALUE(Currencies[UnitOfCurrency])
,ExchangeRate[Date],SELECTEDVALUE(Sales[DateOfSale]),1
))
 
Converted Value based on Slicer(Measure)
Calculated Value = SUMX(Sales, Sales[Cost] * LOOKUPVALUE(ExchangeRate[Rate],
ExchangeRate[CurrencyFrom],SELECTEDVALUE(Sales[UnitOfCurrency])
,ExchangeRate[CurrencyTo],SELECTEDVALUE(Currencies[UnitOfCurrency])
,ExchangeRate[Date],SELECTEDVALUE(Sales[DateOfSale]),1
))
 
Here is the Data that i have used.
CurrencyFromCurrencyToRateDateToCurrency Symbol
USDEURO0.912/20/2019$ USD
USDPOUND0.7612/20/2019$ USD
USDINR71.7812/20/2019$ USD
EUROPOUND0.8512/20/2019€  EURO
EUROINR80.1512/20/2019€  EURO
EUROUSD1.1212/20/2019€  EURO
POUNDUSD1.13112/20/2019£ POUND
POUNDEURO1.1712/20/2019£ POUND
POUNDINR93.8612/20/2019£ POUND
INRUSD0.01412/20/2019₹ Rupee
INREURO0.01212/20/2019₹ Rupee
INRPOND0.01112/20/2019₹ Rupee
USDEURO0.9512/28/2019 
USDPOUND0.7112/28/2019 
USDINR74.7812/28/2019 
EUROPOUND0.812/29/2019 
EUROINR82.1512/29/2019 
EUROUSD1.2212/29/2019 
EUROPOUND0.812/30/2019 
EUROINR82.1512/30/2019 
EUROUSD1.2212/30/2019 
POUNDUSD1.33112/31/2019 
POUNDEURO1.2712/31/2019 
POUNDINR95.8612/31/2019 
USDEURO0.912/25/2019 
USDPOUND0.7612/25/2019 
USDINR71.7812/25/2019 
EUROPOUND0.8512/25/2019 
EUROINR80.1512/25/2019 
EUROUSD1.1212/25/2019 

 

 

Sales Data.

 

ItemIDCostQTYUnitOfCurrencyDateOfSale
Item1302USD12/20/2019
Item2455USD12/20/2019
Item3703USD12/20/2019
Item4452EURO12/20/2019
Item5306POUND12/20/2019
Item6102POUND12/20/2019
Item72302EURO12/25/2019
Item828USD12/25/2019
Item9674INR12/20/2019
Item10232USD12/28/2019
Item11561EURO12/29/2019
Item12233EURO12/30/2019
Item13566POUND12/31/2019

 

1 ACCEPTED SOLUTION
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @nssidhu74 

 

try this measures.

 

ExchangeRateForSelectedCurrency = 
IF (
    HASONEVALUE ( Sales[UnitOfCurrency] ),
    SUMX (
        Sales,
        LOOKUPVALUE (
            ExchangeRate[Rate],
            ExchangeRate[CurrencyFrom], Sales[UnitOfCurrency],
            ExchangeRate[CurrencyTo], SELECTEDVALUE ( Currencies[UnitOfCurrency] ),
            ExchangeRate[Date], Sales[DateOfSale],
            1
        )
    ),
    BLANK ()
)

 

Calculated Value = 
SUMX (
    Sales,
    Sales[Cost]
        * LOOKUPVALUE (
            ExchangeRate[Rate],
            ExchangeRate[CurrencyFrom], Sales[UnitOfCurrency],
            ExchangeRate[CurrencyTo], SELECTEDVALUE ( Currencies[UnitOfCurrency] ),
            ExchangeRate[Date], Sales[DateOfSale],
            1
        )
)

 

A conditional column header is actual not possible.

 

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


View solution in original post

2 REPLIES 2
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @nssidhu74 

 

try this measures.

 

ExchangeRateForSelectedCurrency = 
IF (
    HASONEVALUE ( Sales[UnitOfCurrency] ),
    SUMX (
        Sales,
        LOOKUPVALUE (
            ExchangeRate[Rate],
            ExchangeRate[CurrencyFrom], Sales[UnitOfCurrency],
            ExchangeRate[CurrencyTo], SELECTEDVALUE ( Currencies[UnitOfCurrency] ),
            ExchangeRate[Date], Sales[DateOfSale],
            1
        )
    ),
    BLANK ()
)

 

Calculated Value = 
SUMX (
    Sales,
    Sales[Cost]
        * LOOKUPVALUE (
            ExchangeRate[Rate],
            ExchangeRate[CurrencyFrom], Sales[UnitOfCurrency],
            ExchangeRate[CurrencyTo], SELECTEDVALUE ( Currencies[UnitOfCurrency] ),
            ExchangeRate[Date], Sales[DateOfSale],
            1
        )
)

 

A conditional column header is actual not possible.

 

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.