Forum Discussion
Dynamic x axis - show only January - selected month
- 9 years ago
Hi,
you could look at creating new measure that specifically looks at the selected filter and takes that as the max date but overrides the filter on the calculate
This is assuming that you have a Dates table for filtering. (if no dates table let me know what you have got)
ActualToSelectedMonth:=
var MaxDate = MaxDates([DateKey])
return
CALCULATE (
[Actual], ALL('Dates')
DATESYTD ( Dates[Datekey], "01/31" ),
Dates[DateKey] < MaxDate
)-------
(the DATESYTD will need your month end day and month in there to know when to start from....) have edited to January for now.
in theory this should replace the current context filter on Month (again assuming it's in the dates table) for [actual] but still using it as a Max filter.
I've not got the same data as you so I'm hoping the above makes sense and assists.
Hi,
you could look at creating new measure that specifically looks at the selected filter and takes that as the max date but overrides the filter on the calculate
This is assuming that you have a Dates table for filtering. (if no dates table let me know what you have got)
ActualToSelectedMonth:=
var MaxDate = MaxDates([DateKey])
return
CALCULATE (
[Actual], ALL('Dates')
DATESYTD ( Dates[Datekey], "01/31" ),
Dates[DateKey] < MaxDate
)
-------
(the DATESYTD will need your month end day and month in there to know when to start from....) have edited to January for now.
in theory this should replace the current context filter on Month (again assuming it's in the dates table) for [actual] but still using it as a Max filter.
I've not got the same data as you so I'm hoping the above makes sense and assists.