Forum Discussion
Calculating Amount Column
- 5 years ago
Hi Anonymous ,
First create a month column to get the month number in 2 tables;
Then create 2 columns respectively in the 2 tables:
average exchange rate = AVERAGEX(FILTER(ALL('Currency Exchange Rate'),'Currency Exchange Rate'[Month No]=EARLIER('Currency Exchange Rate'[Month No])),[ Exchange_Rate])average exchange rate = LOOKUPVALUE('Currency Exchange Rate'[average exchange rate],'Currency Exchange Rate'[Month No],'GL Entry'[Month No],0)And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
Hello,
Thanks for the response but I think the averageX only takes the exchange rate from the last day of every month in the calculation, correct me if I'm wrong. Anyway, your response helps me understand DAX better.
I need to make the average exchange rate of all days in one month then calculate the Amount EUR column for the same month. Same for every month.
Sorry if I got something wrong 🙂
Hi Anonymous ,
First create a month column to get the month number in 2 tables;
Then create 2 columns respectively in the 2 tables:
average exchange rate = AVERAGEX(FILTER(ALL('Currency Exchange Rate'),'Currency Exchange Rate'[Month No]=EARLIER('Currency Exchange Rate'[Month No])),[ Exchange_Rate])average exchange rate = LOOKUPVALUE('Currency Exchange Rate'[average exchange rate],'Currency Exchange Rate'[Month No],'GL Entry'[Month No],0)
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
- Anonymous5 years agoNot applicable
Hello kelly,
Sorry for the late response. I also needed to add the year in the "Month No" column but it was just a small detail.. Your implementation worked perfectly, thanks for the help!
Best regards