Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to build a line chart showing each month for the last 12 months count of the "LeadType" value. When the user selects the dates from the filter pane, the Max(Date) would be used to determine the last 12 months. I've found so many different ways people have done similar calculations, but none seem to work.
Here is my last attempt before posting the question:
Dimension:
=[Date.autoCalendar.MonthYear]
Measure:
=Count({$<MonthsAgo={">=0<12"}>} LeadType)
can you share a sample data ?
Unfortunately, I am not able to post the data to the internet. I just need the total count of the "LeadTypes" for each month for 12 months based on the max date selected by the user in the filter pane.
Here is the format of the data:
LeadDate, LeadType
'MM/DD/YYYY', NEWSLETTER
Lead Types
NEWSLETTER
CATALOG
CONTACT
SAMPLE
DOWNLOAD
This is the current bar chart showing the filtered months. I just need it to show prior 12 months from max date (Dec 2019).
I have tried this expression and when I select a date in the filter pane it filters the data.
count({<vMaxDate = {"$(='>=' & Date(AddYears(vMaxDate, -12), 'MM/DD/YYYY') & '<=' & Date(vMaxDate, 'MM/DD/YYYY'))"}>}LeadType)
sample data is necessary to understand. But that's okay.
Are you only looking for the last 12 months counts, I suggest you to compare the dates and not the months.
Is this formula okay ?
=Count({$<DateAgo= {">=$(=AddMonths(Date(Today(),'MM/DD/YYYY'),-12))"}>} LeadType)