cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kwats005 Frequent Visitor
Frequent Visitor

Dynamic Conditional Formatting Based On Previous Year

Hello there,

Could I get assistance with conditional formatting. I need to be able to change colors based on previous year.  So, if the amount last year is greater than this year then I would like to change the color of this year Red to show that is “bad”, and if last years totals were less than this year then I would like to change the color of this year total to be Green to show that this year we did “good.” I don’t think this is possible with conditional formatting because the values for each order type are constantly changing from year to year. Please let me know if you have any ideas. Thank you in advance!

 

Some example numbers below.

Order Type

Sales

Sales Last Year

Ship Amount

Ship Last Year

1

$18,000

$16,000

$6,000

$9,000

2

$12,000

$12,500

$7,000

$6,500

3

$20,000

$17,000

$10,000

$12,000

 

What I would like it to show. 

Order Type

Sales

Sales Last Year

Ship Amount

Ship Last Year

1

$18,000

$16,000

$6,000

$9,000

2

$12,000

$12,500

$7,000

$6,500

3

$20,000

$17,000

$10,000

$12,000

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Dynamic Conditional Formatting Based On Previous Year

Hello @kwats005 

You can write a measure to apply the formatting.

FORMAT Sales Amount = IF ( [Sales Amount] > [Sales Last Year], "GREEN", "RED")

The use it in conditional fomatting to color the text.

conditionalformatYoY.jpg

You would just need a formatting measure for each column but it should work in all contexts.

FORMAT Sales Last Year = IF ( [Sales Amount] < [Sales Last Year], "GREEN", "RED")

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Dynamic Conditional Formatting Based On Previous Year

Hello @kwats005 

You can write a measure to apply the formatting.

FORMAT Sales Amount = IF ( [Sales Amount] > [Sales Last Year], "GREEN", "RED")

The use it in conditional fomatting to color the text.

conditionalformatYoY.jpg

You would just need a formatting measure for each column but it should work in all contexts.

FORMAT Sales Last Year = IF ( [Sales Amount] < [Sales Last Year], "GREEN", "RED")

View solution in original post

kwats005 Frequent Visitor
Frequent Visitor

Re: Dynamic Conditional Formatting Based On Previous Year

That works perfectly! Thank you so much!

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 504 members 4,476 guests
Please welcome our newest community members: