I'm trying to create an indicator in my dashboard that includes only the records in my dataset from the month associated with the most recent records. (I don't want to use the built in Last Month option in the Data options section of the indicator because there will be a lag at the beginning of each month when the dashboard is updated.)
I'm trying to write an Arcade expression for this but am a newcomer and am struggling a bit with this.
Right now my expressions runs but it only returns the records associated with the latest date, not all of the records in the latest month which is what I want. See expression below - if I change YYYY-MM-DD in the 4th line to MMM, then no records are returned.
I feel like there's probably a very simple solution to this but I can't seem to figure it out.
Any suggestions are appreciated.
Thank you,
Samara
var fields = ["objectid", "date", "category", "closed"]
var fs = FeatureSetByPortalItem(Portal("PORTAL NAME"), "LAYER ID", 0, fields)
var open_issues = Filter(fs, "closed = 'No'")
var maxDate = Text(Date(Max(open_issues, 'date')), 'YYYY-MM-DD')
var subsetByDate = Filter(open_issues, "date = @maxDate")
return subsetByDate