Forum Discussion
Measure for combining multiple months into one?
Hi there. I've made a clustered column chart that shows the top 5 from a set of values over the past 3 months. With a date column forming my X axis, I end up with 3 sets of 5 columns - the top 5 in Oct, the top 5 in Nov, and the top 5 in Dec. Is there a quick win to combine these together, so the chart shows just 5 columns, as opposed to 15? I'm not sure if something like a date measure for 'last 3 months' exists, and if it would work for an X axis - hopefully that makes sense.
Hi AC23VM
you can try these formula
Column = VAR CurrentDate = DATE ( 2017, 12, 31 ) VAR StartingPoint = EOMONTH ( CurrentDate, -3 ) + 1 RETURN Table1[Date] >= StartingPoint && Table1[Date] <= CurrentDateOR
CALCULATE(distinctCOUNT('Date'[Month Year]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,MONTH)
I hope I answered your question!
2 Replies
- Uzi2019Community Champion
Hi AC23VM
you can try these formula
Column = VAR CurrentDate = DATE ( 2017, 12, 31 ) VAR StartingPoint = EOMONTH ( CurrentDate, -3 ) + 1 RETURN Table1[Date] >= StartingPoint && Table1[Date] <= CurrentDateOR
CALCULATE(distinctCOUNT('Date'[Month Year]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,MONTH)
I hope I answered your question!