Forum Discussion
Anonymous
6 years agoNot applicable
Date picker
Hi, My input dataset is as follows: The date picker will show all the dates. Based ont he dates I choose fromt he date picker, the table will have last 4 months from the selected date d...
Anonymous
6 years agoNot applicable
Hi Anonymous ,
According to my understanding, you want to dynamically display the data for the last four months based on the slicer, right?
You could use the following formula:
//create a table for slicer
forSlicer =
ALLSELECTED ( 'Dynamic'[Date] )last4 =
VAR selected =
MAX ( forSlicer[Date] )
VAR minDate = selected - 4 * 30
RETURN
IF (
SELECTEDVALUE ( 'Dynamic'[Date] ) <= selected
&& SELECTEDVALUE ( 'Dynamic'[Date] ) >= minDate,
1,
0
)My visualization looks like this:
Is the result what you want? If not, please upload some data samples and expected output.
Please do mask sensitive data before uploading.
Best Regards,
Eyelyn Qin