Forum Discussion
Anonymous
6 years agoNot applicable
Dynamic Text Box based on relative date filter
Hello again, Im looking to make a dynamic text box indicating what the dates are for the current filter. For example, I have a last calendar week relative data filter. I need the text box to say:...
- Anonymous6 years ago
HI Anonymous,
According to your description, it sounds like your table date range not completed. If this is a case, I think you need to do some calculation to expand them to full week records.
Measure = VAR _min = MINX ( VALUES ( 'Table'[Date] ), [Date] ) VAR _max = MAXX ( VALUES ( 'Table'[Date] ), [Date] ) VAR _minCal = _min - WEEKDAY ( _min, 2 ) + 1 VAR _maxCal = _max + ( 7 - WEEKDAY ( _max, 2 ) ) RETURN _minCal & "-" & _maxCalRegards,
Xiaoxin Sheng
Anonymous
6 years agoNot applicable
HI Anonymous,
According to your description, it sounds like your table date range not completed. If this is a case, I think you need to do some calculation to expand them to full week records.
Measure =
VAR _min =
MINX ( VALUES ( 'Table'[Date] ), [Date] )
VAR _max =
MAXX ( VALUES ( 'Table'[Date] ), [Date] )
VAR _minCal =
_min - WEEKDAY ( _min, 2 ) + 1
VAR _maxCal =
_max
+ ( 7 - WEEKDAY ( _max, 2 ) )
RETURN
_minCal & "-" & _maxCal
Regards,
Xiaoxin Sheng
Anonymous
6 years agoNot applicable
Anonymous
Your solution works for my specific requirement when the +1 is deleted and (7- WEEKDAY(_max,2) is changed to (7- WEEKDAY (_max,1). Thanks!