Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ankuragrawal
Partner - Contributor
Partner - Contributor

Colour by measure value in column of a table

I have a column naming "sales" with values ranging from 1 to 10000

I need to make the background colour of the cell from a lighter shade of red to a darker one depending on the value of cell but i am not able to find colour by measure option for data in table.Please help

4 Replies
JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @ankuragrawal, I suggest to use the ARGB function, using the first parameter to make the color more or less transparent:

ARGB(Sum(sales) * 255 / 10000, 255, 0, 0)

JG

GaryGiles
Specialist
Specialist

You can use the RGB function with Sales.  You may need to adjust if you are aggregating the Sales figure.

=RGB(255-(100*(Sales/max(Total Sales))),
230-(240*(Sales/max(Total Sales))),
230-(240*(Sales/max(Total Sales))))

ankuragrawal
Partner - Contributor
Partner - Contributor
Author

its working,but however i have some negative values also and its not working for them

JuanGerardo
Partner - Specialist
Partner - Specialist

Then you should have to shift the interval. For example, if you have values between -10,000 and +10,000,  adding 10,000 to your value and dividing by the new width of 20,000:

ARGB((Sum(sales) + 10000) * 255 / 20000, 255, 0, 0)

JG