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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Jackie003
Frequent Visitor

Sum of sales with different currency rate for each month

Hello, I would like to ask you for help. I need to calculate Total sales with PLN currency and EUR. I need to calculate in dax Total Sales with EUR currency (every month has different rate). Of course between these tables is relationship - many to 1 

Jackie003_0-1716545614992.png

 

2 ACCEPTED SOLUTIONS
mark_endicott
Super User
Super User

@Jackie003 

 

I think the DAX below should work, so long as your relationship is set up as I anticipate it is.

 

 

    VAR Sales_in_Currency =
        ADDCOLUMNS (
            SUMMARIZE (
                'PLN Table',
                'PLN Table'[Date]
            ),
            "Amt_In_Currency", SUM(Sales PLN),
            "Rate",
                CALCULATE (
                    SELECTEDVALUE ( 'EUR Table'[EUR] )
                )
        )
    VAR calc =
        SUMX (
            Sales_in_Currency,
            [Amt_In_Currency] * [Rate]
        )
    RETURN
        calc
	)

 

 

It's not clear what you tables are named, so I have done my best to make this easy to see. 

 

If this works, please could you mark this as the solution?

View solution in original post

Hi @Jackie003 one possible solution:

create 2 calculated columns in Sales table (order is important) and two measures (starting with M)

EUR_rate = CALCULATE(
    MAX(EUR[EUR]),
    FILTER(EUR,EUR[Date]>=Sales[Date] && EUR[Date]<=Sales[Date])
    )
 
Sales_EUR = ROUND(Sales[Sales_PLN]*Sales[EUR_rate],0)
 
 
Measures:
M_Sales_PLN = SUM(Sales[Sales_PLN])
M_Sales_EUR = SUM(Sales[Sales_EUR])

some_bih_0-1716552936145.png

 

some_bih_1-1716553009110.png

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






View solution in original post

5 REPLIES 5
mark_endicott
Super User
Super User

@Jackie003 

 

I think the DAX below should work, so long as your relationship is set up as I anticipate it is.

 

 

    VAR Sales_in_Currency =
        ADDCOLUMNS (
            SUMMARIZE (
                'PLN Table',
                'PLN Table'[Date]
            ),
            "Amt_In_Currency", SUM(Sales PLN),
            "Rate",
                CALCULATE (
                    SELECTEDVALUE ( 'EUR Table'[EUR] )
                )
        )
    VAR calc =
        SUMX (
            Sales_in_Currency,
            [Amt_In_Currency] * [Rate]
        )
    RETURN
        calc
	)

 

 

It's not clear what you tables are named, so I have done my best to make this easy to see. 

 

If this works, please could you mark this as the solution?

mark_endicott
Super User
Super User

@Jackie003 

 

I think the DAX below should work, so long as your relationship is set up as I anticipate it is.

 

 

    VAR Sales_in_Currency =
        ADDCOLUMNS (
            SUMMARIZE (
                'PLN Table',
                'PLN Table'[Date]
            ),
            "Amt_In_Currency", SUM(Sales PLN),
            "Rate",
                CALCULATE (
                    SELECTEDVALUE ( 'EUR Table'[EUR] )
                )
        )
    VAR calc =
        SUMX (
            Sales_in_Currency,
            [Amt_In_Currency] * [Rate]
        )
    RETURN
        calc
	)

 

 

It's not clear what you tables are named, so I have done my best to make this easy to see. 

 

If this works, please could you mark this as the solution?

some_bih
Super User
Super User

Hi @Jackie003 you need solution in Excel with DAX or in Power BI?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






In Power Bi.

What's more, every month new currency rate is updated 🙂 

Hi @Jackie003 one possible solution:

create 2 calculated columns in Sales table (order is important) and two measures (starting with M)

EUR_rate = CALCULATE(
    MAX(EUR[EUR]),
    FILTER(EUR,EUR[Date]>=Sales[Date] && EUR[Date]<=Sales[Date])
    )
 
Sales_EUR = ROUND(Sales[Sales_PLN]*Sales[EUR_rate],0)
 
 
Measures:
M_Sales_PLN = SUM(Sales[Sales_PLN])
M_Sales_EUR = SUM(Sales[Sales_EUR])

some_bih_0-1716552936145.png

 

some_bih_1-1716553009110.png

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors