cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ys034
Helper I
Helper I

Currency calculation for last year between two tables

Hello Community,

 

I have the following problem and namely I want for last year the sales in the correctly converted currency eg. Pound to Euro for Great Britain
For the current year it works through a calculated column. Does anyone have an idea for this issue?

 

ys034_0-1642773184408.png

 

 

My Measures:

Total Sales LC = SUM('DataTable'[Total Sales Local Currency])
Total Sales LC LY = CALCULATE(SUM('DataTable'[Total Sales Local Currency]),SAMEPERIODLASTYEAR('DateTable'[Date]))
 
Calculated Column: 
Total Sales EUR = [Total Sales LC] / RELATED('Currency Table'[Exchange Rate])
Total Sales EUR LY = [Total Sales LC LY] / RELATED('Currency Table'[Exchange Rate]) (info: a circular dependency was detected)
 
My Model:
 
ys034_1-1642773577118.png

 

thank you in advance

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ys034 , You should not create a column on measure. You should now create a measure only

 

something like

Total Sales LC Curr = SUMX('DataTable', 'DataTable'[Total Sales Local Currency]/ RELATED('Currency Table'[Exchange Rate]))

 

Total Sales LC Curr LY = CALCULATE(SUMX('DataTable', 'DataTable'[Total Sales Local Currency]/ RELATED('Currency Table'[Exchange Rate])),SAMEPERIODLASTYEAR('DateTable'[Date]))

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@ys034 , You should not create a column on measure. You should now create a measure only

 

something like

Total Sales LC Curr = SUMX('DataTable', 'DataTable'[Total Sales Local Currency]/ RELATED('Currency Table'[Exchange Rate]))

 

Total Sales LC Curr LY = CALCULATE(SUMX('DataTable', 'DataTable'[Total Sales Local Currency]/ RELATED('Currency Table'[Exchange Rate])),SAMEPERIODLASTYEAR('DateTable'[Date]))

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors
Top Kudoed Authors