Forum Discussion
Creative_tree88
1 year agoHelper V
Value between Two Dates
Hi - I have the following DAX which is in a calculated column. The issue I'm having is that it's saying there are multiple values where single is expected. Is there any way of adapting this express...
Bibiano_Geraldo
1 year agoSuper User
Hi Creative_tree88 ,
In your Finance Data, Add a new calculated column with the following DAX code:
Value Between Two Dates Lookup =
VAR _start = 'Finance Data'[Sales Letter A Date]
VAR _end = 'Finance Data'[Sales Letter B Date]
VAR _key = 'Finance Data'[KEY]
VAR _codesInRange =
FILTER(
'Sales Data',
'Sales Data'[Sales Date] >= _start &&
'Sales Data'[Sales Date] <= IF(ISBLANK(_end), _start, _end) &&
'Sales Data'[KEY] = _key
)
VAR _result =
CONCATENATEX(
_codesInRange,
'Sales Data'[Code],
", "
)
RETURN
IF(
ISBLANK(_result),
BLANK(),
_result
)
Your output should look like this:
Creative_tree88
1 year agoHelper V
Bibiano_Geraldo So far that looks pretty good! Is it OK to come back to you if I find some anomolies, just to see if anything can be done to resolve these too? Many thanks indeed!
- Bibiano_Geraldo1 year agoSuper User