5 Replies Latest reply on Feb 4, 2019 7:37 AM by Timothy Manning

# Conditional formatting of measure & different measures in same cell

Hey

I've got 2 separate unanswered questions, hope you could help me out

1. Conditional formatting of a measure

How can i create a measure that changes it's color dynamically with a given condition?

For example, lets say this is my table:

 Country ROI Spend GER 120% 400 FRA 130% 10 USA 170% 300 CAN 50% 200

I would like to create a condition to the ROI measure only that changes the values colors. For example, IF ROI>140% THEN 'Green' ELSE 'Red' END. (something like that)

2. I wonder if there is any way to show 2 different measures in one cell. for example in the table above, spend and % of total, in the same cell. It should look like that:

 Country ROI Spend MyWish GER 120% 400 400 , 44% FRA 130% 10 10 , 1% USA 170% 300 300, 33% CAN 50% 200 200 , 22%

(400 is 44% of the total column, 10 is 1% etc.)

Hope my questions are clear,

Thanks a lot !

• ###### 1. Re: Conditional formatting of measure & different measures in same cell

Hi Dolev, is this what you want?

I did the exact same calculation for colour that you did.

Let me know if it doesn't make sense,

Tim

• ###### 2. Re: Conditional formatting of measure & different measures in same cell

For your second condition I would convert the values to strings and concatenate them with a "/" between the two values..

• ###### 3. Re: Conditional formatting of measure & different measures in same cell

Hey Timothy

Thanks for the prompt response.

Regarding the color thing- i meant coloring the ROI column.

More general definition will be- I want to create conditional formatting (color) for each measure

For the 2 measures cell- its a nice idea, but how can i do more than one column with 2 measures cells? for example another column with ROI and it's different from average.

thanks again

• ###### 4. Re: Conditional formatting of measure & different measures in same cell

If you want to color the ROI field you may want to look at conditionally coloring the cell background.  You can find numerous articles on this is in the forum.  I would just point out that Tableau is not Excel and if you want to recreate something from Excel then you are going to be very frustrated.

As for the second point, I can put any number of cell values into one cell.  str(ROI)+'/'+[Country]+'/'+[anyValueInMyData]

• ###### 5. Re: Conditional formatting of measure & different measures in same cell

I think this is what you're looking for? Then if you want to use more measures, just copy the process I've done for these.

It was a fun exercise to try and figure out how to do this, but I agree with (the other) Tim that you could show this data in a more informative way than a conditionally formatted table.

Hope that helped!

Tim