Forum Discussion
Dynamic Graph month
I have a calendar filter to choose a month.
I have a bar Graph with quantity tickets x System Name X Month.
I need show in this graph the last 12 months considering the month selected in filter.
Examples:
If I choose February 2016. The graphic should show from February 2015 to February 2016.
If I choose June 2014, the graph should show from June 2013 to June 2014.
11 Replies
- FrametResolver II
Hi,
The last time I needed to do this I had to create a measure that returned values during the month range I wanted else blank() and therefore PowerBI would only show the axis where values existed. I don't think you can have dynamic ranges set on axis yet or do this within PowerBI withouth writing measures.
Assuming your existing measure is something like:
MyMeasure=SUM(Tickets)
Then you can create a new measure for the last 12 months only:My12MonthMeasure = CALCULATE ( [MyMeasure], FILTER ( ALL ( DateTable[DateColumn] ), [DateColumn] > EOMONTH ( MAX ( [DateColumn] ), -12 ) && [DateColumn] <= EOMONTH ( MAX ( [DateColumn] ), 0 ) ) )This hopefully returns a count of tickets provided the date is less than or equal to the current date selected and greater than 12 months prior to the current date selected. (In whole months).
Hope this helps at least a little.
Thanks
Thomas
- austinsenseImpactful Individual
https://msdn.microsoft.com/en-us/library/ee634539.aspx
=CALCULATE( [whatever_measure_you're_using], DATESINPERIOD(Calendar(Date], MAX(Calendard[Date]), -12, MONTH) )- thliberatoHelper I
austinsense, Good Morning.
It did not work out as I expected.
This is the Example.
I Have a Filter Data to choose one month. When I choose the month, my Graph needs show me only last 12 month, including the month selected.Once again, thank you.
- austinsenseImpactful Individual
Sorry this is my fault - I answered the wrong question :/
You're looking for a dynamic filter on the date axis - I have to get to a meeting but I can take a look at this later.