Forum Discussion
a68tbird
Resolver II
4 years agoAverageIfs in DAX / LOOKUPVALUE
Hello All - I'd like to add a calculated column to my Sales table (AllSales) that will return the relevant exchange rate. The ExchangeRate table has daily rates, in four currencies. What I would...
- 4 years ago
a68tbird Try something like:
Column = VAR __Date = [salesDate] VAR __Year = YEAR(__Date) VAR __Month = MONTH(__Date) RETURN AVERAGEX(FILTER(ALL('ExchangeRates'),'ExchangeRates'[Year] = __Year && 'ExchangeRates'[ClosingMonth] = __Month),'ExchangeRates'[Rate])
a68tbird
Resolver II
4 years agoThank you both, Greg_Deckler and Ashish_Mathur . I used your solution Greg_Deckler , and included currency in the filter too. Works perfectly!