Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a Date field and i want separate two filter as Start date and End Date and show the data in the chart according to the filter selection (range).
How can i achieve that ?
Could you please help me.
Thanks,
Jishnu
You can do as follow without changing ur script
let's assume this is your data :
Load * Inline [
YourDateField, sales
01/01/2020 , 100
02/02/2020 , 300
03/02/2020 , 400
04/02/2020 , 300
05/02/2020 , 600
06/02/2020 , 200
07/02/2020 , 300
08/02/2020 , 500
09/02/2020 ,100
10/02/2020 , 1000
];
1) create 2 filters :
- Start Date as follow : YourDateField
- End Date as follow : =aggr(only({<YourDateField={">=$(=min(YourDateField))"}>}YourDateField),YourDateField)
=> that way, when you select a date in your Start Date filter, you'll only have dates >= your selected date in your End Date filter..
Now, in your measure, do as follow :
Sum({<YourDateField={">=$(=min(YourDateField))<=$(=max(YourDateField))"}>}sales)
Result:
No selection :
2) I select 04/02/2020 in my Start Date , i'll only have dates >= my selection in the End Date filter :
I now select 08/02/2020 in my enddate, and i'll have the range between both dates:
Et voilà !
Thanks Kush it worked!!