Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to show last two months in bar chart
Flters:
year :2016
like if I select dec 2016 in bar chart I want to display oct 2016 and nov 2016.
so when ever I select any month it should show before two months data dynamically.
can anyone show me the expression to achieve this?
Thanks
Sony
Create a date field from MonthYear as MonthStart
Sum({$<[MonthStart]={">=$(=Date(AddMonths(Max(MonthStart),-2)))"}>}[Invoive Total])
Sum({$<[MonthYear]={"$(=Date(AddMonths(Max(MonthYear), -2), 'MMM-YYYY'))"}>}[Invoive Total])
Hi,
it is showing '0'
What is the format of MonthYear Field?
Date or String?
Create a date field from MonthYear as MonthStart
Sum({$<[MonthStart]={">=$(=Date(AddMonths(Max(MonthStart),-2)))"}>}[Invoive Total])
Make 2 variable.
1st one is:
Previous Month: =month(MakeDate(2000,vMaxMonth-1))
2nd one is:
2nd last Previous Month: =month(MakeDate(2000,vMaxMonth-2))
vMaxMonth: =Month(Max(DATE))
In Bar chart expression will be
For Previous Month: Sum({<Year={$(=Max(Year))},Month={'$(vPreviousMonth)'}>}Sales)
For 2nd last previous Month: Sum({<Year={$(=Max(Year))},Month={'$(v2ndPrvmonth)'}>}Sales)