Forum Discussion
yodha
Helper IV
7 years agoDAX for Text box
i have start date field in my data like this, i am using a slicer for start date in my report like this, and i have a text box for duration in my report like this if i select...
Anonymous
7 years agoNot applicable
Well, all your measures must be aware of the selection in the slicer(s) and return BLANK for the days that are outside of the defined period. If they do, then the column below such an out-of-period date will store BLANKs only and in effect, the column will not be shown.
Best
Darek
yodha
Helper IV
7 years agoHi,
but how to do this, can you please provide an example.
thanks in advance.
- Anonymous7 years agoNot applicable
-- Let A be any measure in the model. -- Then let B be the version that you're -- after. B = var __dayVisibleInSlicer = SELECTEDVALUE( DaySlicer[Day] ) var __numOfDaysVisibleInSlicer = SELECTEDVALUE( NumOfDaysSlicer[Number of Days] ) var __startDate = __dayVisibleInSlicer var __endDate = __dayVisibleInSlicer + __numOfDaysVisibleInSlicer - 1 var __dayVisibleInCurrentContext = SELECTEDVALUE( 'Calendar'[Date] ) var __dayVisibleInCurrentContextIsBetweenBounds = __startDate <= __dayVisibleInCurrentContext && __dayVisibleInCurrentContext <= __endDate var __b = if( __dayVisibleInCurrentContextIsBetweenBounds, [A] ) return __b
Best
Darek