Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
VishalSingh18
Contributor III
Contributor III

I want to display recent 2 years(current & prior) on a bar or line with month as dimension

Hello

My Date Dimension is CreatedDate and I want the graph to dynamically show values for the recent 2 years using 2 different lines/bar but event after lots of searching through community nothing seems to work

right now I am using Month(CreatedDate) along with year(CreatedDate) but it will just keep adding more lines as year count increases

Please help me with it

Thanks

Labels (2)
1 Solution

Accepted Solutions
Kushal_Chawda

Create Month & Year field in your data model using calendar.

Then create line chart

Add 2 Dimensions:

1) Month

2) aggr(only({<Year={">=$(=max(Year)-1)"}>}Year),Year)

Measure:

Sum(Sales)  or whichever measure you want to select

View solution in original post

2 Replies
Kushal_Chawda

Create Month & Year field in your data model using calendar.

Then create line chart

Add 2 Dimensions:

1) Month

2) aggr(only({<Year={">=$(=max(Year)-1)"}>}Year),Year)

Measure:

Sum(Sales)  or whichever measure you want to select

VishalSingh18
Contributor III
Contributor III
Author

Thank you very much i really helped