Forum Discussion
Last 12 months
Hi,
I want to know if it is possible choose one month from my slicer calendar, and then the chart shows last 12 months from 2 or more years.
Example: I choose Mai 2016, and then the chart shows jun 15 - mai 16 (12 months)
and if I had 2014, the charts shows another line from 2014 with the same period.
- Anonymous9 years ago
I followed this script: http://blog.crossjoin.co.uk/2013/11/19/generating-a-date-dimension-table-in-power-query/
used this calculated column
Ultimoano = if(AND([Date]>=[Today]-365;[Date]<=[Today] );"Último Ano";"Anterior")
and I got what I want.
6 Replies
- AnonymousNot applicableAnyone?
- AnonymousNot applicable
Hi Anonymous
You may check the link and see if it works for you.
You may have to build the measure for 2 years before making some changes to the formula for last 13 months.
If it works accpet this as a solution and also give KUDOS.
Cheers
CheenuSing
- v-haibl-msftMicrosoft Employee
A great solution… With matemusic's method, If we need the period from 2014, we can create another measure by only changing MAX ( 'Year'[Year] ) to MAX ( 'Year'[Year] ) - 1. But we need to put them into two different visual charts since the X-Axis is YearMonth.
Best Regards,
Herbert
- AnonymousNot applicable
Sorry, I didn't explain myself very well.
What i really want is a chart like this:
- v-haibl-msftMicrosoft Employee
Anonymous
I don’t think it is possible to have a chart like you drew. In above chart, the X-Axis only has months without year specified, however you need one line in Y-Axis contains two years’ value. And the month order will not be like you desired with no year.
Best Regards,
Herbert
- AnonymousNot applicable
I followed this script: http://blog.crossjoin.co.uk/2013/11/19/generating-a-date-dimension-table-in-power-query/
used this calculated column
Ultimoano = if(AND([Date]>=[Today]-365;[Date]<=[Today] );"Último Ano";"Anterior")
and I got what I want.