I'm trying to create a line chart with the data for only the current month. My date field is called PurchaseDate
. I use this also for the 'Date Range Picker' widget in my dashboard. My dimension is PurchaseDate
and my measure is PurchaseVolume
. My data looks like this:
How can I set a condition to use only the current/latest month for my line chart?
I tried using a variable like this:
CurrentMonth = Max(PurchaseDate)
And I set the expression in my line chart to:
Dimension: if(CurrentMonth, PurchaseDate)
Measure: if(CurrentMonth, PurchaseVolume)
But here, my values keep changing according to the selected date on the Date Ranger Picker. How can I set the line chart for only the latest month (so the dimension will have each day of the latest month, which in this case will be Jan 2022) independent of the Date Range Picker? Is there a way I can set the calculation condition?