Forum Discussion
thliberato
Helper I
9 years agoDynamic 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. ...
Framet
Resolver II
9 years agoHi,
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