Forum Discussion
pconnon
7 years agoFrequent Visitor
Calculate FIXED months between two dates
I'm trying to calculate a count of months between date slicer dates to used it as a denomitar in order to calculate an average based on all periods for all customers. The idea is to calculate th...
- 7 years ago
I tried this solution, but the problem was that when I use the result on a table with all my customers this value was reevaluated for each customer with only the dates on which the sales where made and I needed a fixed value.
What I did was to create a new table CALENDAR
Calendar = CALENDAR( DATE(2015;01;01) ; DATE(2020;01;01))and use these values on the slicer instead of the sales dates. With these changes I was able to calculate a sales frequency for each customer on a fixed period.
thanks!
Greg_Deckler
7 years agoCommunity Champion
Seems like you could use DATEDIFF of the MAX and MIN of your slicer.