Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Date format : DD/MM/YYYY
I need to create a Dynamic Bookmark on date field filter for current day -1. If someone can help please do
I tried the below expressions but no luck
=Num([Date Field]) = Max(Total[Date Field] -1)
If I don't subtact 1 I'm getting the max date value with this
=Num([Date Field]) = Max(Total[Date Field])
If you're just trying to get the max value within your entire dataset (ignoring all filters), then this should do it:
max({1} [Date Field])-1
or if you need it formatted a certain way, wrap it in date():
date(max({1} [Date Field])-1,'DD/MM/YYYY')
Maybe in this way: =Num([Date Field]) = (Max([Date Field]) -1)
I have tried these already they didn't work
No it didn't work
@sunny_ryuke I need filter data based on Date filed using bookmark. so used one filter pane with respective date field and applied below expression in that filter search box and the created bookmark.
=Date(Field,'DD/MM/YYYY')>=Date(Yearstart(today(),0,4),'DD/MM/YYYY')
I'm not sure why that doesn't work. I've implemented similar many times, and it always works fine. It might be the way you're applying the filter. I think I should have expanded on my original post:
This is how to set the variable:
If you're just trying to get the max value within your entire dataset (ignoring all filters), then this should do it:
max({1} [Date Field])-1
or if you need it formatted a certain way, wrap it in date():
date(max({1} [Date Field])-1,'DD/MM/YYYY')
... and this is how to apply the filter for the bookmark:
1. Create a filter pane containing your date field.
2. Filter your date field on the variable, not on the value... so in the example below, I have vBookmarkTest set as =max({1} WK_COMM)-7 . I then filter my date field (WK_COMM) as below, specifying that the field must equal the value of the variable. Press enter to make the selection (don't click the tick icon).
3. Create your bookmark.
4. You can then check that this has worked by viewing bookmark details, and you will see that the variable is specified.
@sunny_ryuke I think It will not work since max can be used in Measure and filter works on dimension.
Maybe You can do it in backend and then apply bookmark.
Hi try setting up a variable for vMaxDate
Let vMaxDate = date(today(), 'DD/MM/YYYY');
The use the autoCalender to get the date from your timestamp.
[autoCalendar]:
DECLARE FIELD DEFINITION Tagged ('$time','$Date')
FIELDS
Date(Floor($1)) AS [Date] Tagged ('$axis', '$date', '$qualified'),
DERIVE FIELDS FROM FIELDS
your_date_time
USING [autoCalendar] ;
Go to your date field and add in the following, it should then show your required date
=your_date_time.autoCalendar.Date=vMaxDate
Save your bookmark now.