Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all,
I am looking for a best practice to fill missing days with my €/£ Quandl currency conversion API. The API feeds in currecny conversion for week days but returns null values during weekends and holdays. At the moment I have created a column which replaces the null values with the historical average rate:
Currency = IF(ISBLANK(calculate(sum(EURvsGBP[Value]))),average(EURvsGBP[Value]), calculate(sum(EURvsGBP[Value])))
Is there any better way of doing this? Ideally I would want a) the average to be weekly based, or b) replace the null values with the previous non-null.
Thank you.
Solved! Go to Solution.
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.
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.
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?
User | Count |
---|---|
139 | |
113 | |
103 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |