Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I'm making a bar chart with (name of data field):
- 2 dimensions: Month ([Date.autoCalendar.Month]) -> Year ([Date.autoCalendar.Year]);
- 1 measure: Actual Sales ([Sales])
So far, the chart looks like this:
However I would like to show only 2 bars of this year and last year.
I have researched some solutions on the forum and tried to follow, but it seems not working for my case.
Here are some examples of expressions I tried for the measure [Sales]:
Sum ({$<Year={">=$(=max(Year)-1)"}>} Sales)
Result (if follow directly, it still shows all):
Sum ({$<[Date.autoCalendar.Year]={">=$(=max(Year)-1)"}>} [Sales])
Result:
Sum ({$<[Date.autoCalendar.Year]={">=$(=max(Date.autoCalendar.Year)-1)"}>} Sales)
Result:
Can anyone help to guide me where have I done wrong and how to fix it?
I think I got one solution to use Set Analysis with OR condition applied to YearsAgo field:
Sum ({< [Date.autoCalendar.YearsAgo]={'0'}> + <[Date.autoCalendar.YearsAgo]={'1'} >} Sales)
I think I got one solution to use Set Analysis with OR condition applied to YearsAgo field:
Sum ({< [Date.autoCalendar.YearsAgo]={'0'}> + <[Date.autoCalendar.YearsAgo]={'1'} >} Sales)