Forum Discussion
Best way to fix missing days for currency conversion API
- 10 years ago
Supposing the dataset is as below.
Check a measure as
Currency = VAR lastNoBlankValDate = MAXX ( FILTER ( ALL ( EURvsGBP ), EURvsGBP[DATE] <= MAX ( EURvsGBP[DATE] ) && EURvsGBP[VALUE] <> BLANK () ), EURvsGBP[DATE] ) RETURN CALCULATE ( SUM ( EURvsGBP[VALUE] ), FILTER ( ALL ( EURvsGBP ), EURvsGBP[DATE] = lastNoBlankValDate ) )Regarding week-based, check if Week-Based Time Intelligence in DAX helps.
Supposing the dataset is as below.
Check a measure as
Currency =
VAR lastNoBlankValDate =
MAXX (
FILTER (
ALL ( EURvsGBP ),
EURvsGBP[DATE] <= MAX ( EURvsGBP[DATE] )
&& EURvsGBP[VALUE] <> BLANK ()
),
EURvsGBP[DATE]
)
RETURN
CALCULATE (
SUM ( EURvsGBP[VALUE] ),
FILTER ( ALL ( EURvsGBP ), EURvsGBP[DATE] = lastNoBlankValDate )
)
Regarding week-based, check if Week-Based Time Intelligence in DAX helps.
- MarcF10 years agoAdvocate IV
Thanks, that works just great! I was wondering now what is the best database modelling practice for currency conversion data. At the moment I have three tables linked by 'Date':
CurrencyTable --- DateTable --- Sales
I have created a currency column in the DataTable with the exchange rate for the missing dates (as the CurrencyTable has no dates for weekends and bank holidays) and call it back in the sales table through a lookup. Is there a better way to do this?
- anandav8 years agoSkilled Sharer
- anandav8 years agoSkilled Sharer
How can this be achieved in a calculated column?
The measure is working but I am trying to create a calculated column to fill the missing values.
Any help will be appreciated.