Forum Discussion
Currency conversion on choosen reporting date
- 5 years ago
Hi MiKeZZa ,
First of all you need to have all you ReportingDateID as Whole numbers
Try the following measure, if this is not the correct result please tell me so I can revise:
Sales Currency = VAR SelectedCurrency = SELECTEDVALUE ( 'Currency'[Code] ) VAR DatesExchange = SUMMARIZE ( Rates, ReportingDate[Month year], Rates[Rate] ) VAR Result = SUMX ( DatesExchange, DIVIDE([AmountSum] , Rates[Rate]) ) RETURN ResultPBIX file attach.
Hi MFelix,
I tried to get it working with the SQLBI method, but couldn't get it working. Be aware that I can't change many things on the existing model.
Editing the OP is giving HTML errors, so here is a new link; download. Does this work?
Hi MiKeZZa ,
First of all you need to have all you ReportingDateID as Whole numbers
Try the following measure, if this is not the correct result please tell me so I can revise:
Sales Currency =
VAR SelectedCurrency =
SELECTEDVALUE ( 'Currency'[Code] )
VAR DatesExchange =
SUMMARIZE (
Rates,
ReportingDate[Month year],
Rates[Rate]
)
VAR Result =
SUMX (
DatesExchange,
DIVIDE([AmountSum] , Rates[Rate])
)
RETURN
Result
PBIX file attach.
- MiKeZZa5 years ago
Post Patron
Hi MFelix,
That's really close to what I want!
I did change the measure in the Divide and that's great for every line. Except the total line. I've tried some things, but that total line is giving me some issues. I've had a way to determine if I'm in a detailline or the totalline, with ISFILTERED. But I don't know what to do in totalline to get what I want.
You also have a clue for that?
I've attacted a new PBIX, with better rates and larger numbers. As you can see the total is not the sum of the lines, but the sum of all the values and then divided by a (I don't know which one) rate.
PBIX can be found here