Forum Discussion
Anonymous
2 years agoNot applicable
Small Multiples - Keep time series on X-axis while filtering on sales in past 12 months
Hi everyone, Use case I am trying to build a small multiples chart that only displays combinations of countries and products where there has been at least one sale in the past 12 months. Chal...
Anonymous
2 years agoNot applicable
amitchandak Thanks for getting back to me.
Based on your input and the youtube video I created the below filter measure. However, when I apply it as a filter to the visual, the x-axis in the small multiples still is filtered to the past 12 months. The purpose of the filter is to identify which combinations of countries and products have had any sales in the past 12 months, but the small multiples should still display the full date range.
CountryProductsWithSalesPast12Months =
var _max = maxx(allselected(Date2), Date2[Date])
var _min = eomonth(_max, -12) +1
var TotalSalesLast12Months =
calculate( [Sales], filter(Date, Date[Date] >=_min && Date, Date[Date <=_max))
RETURN
IF(TotalSalesLast12Months>0,1,0)