
Re: Color expression based on rank(measure)by row
Sunny Talwar Sep 28, 2017 10:16 AM (in response to Prana Nellutla)Why not try like this (if this is only for 1st three ranks)
If(HRank(Sum([# Apps])) = 1, Color1,
If(HRank(Sum([# Apps])) = 2, Color2,
If(HRank(Sum([# Apps])) = 3, Color3)))

Re: Color expression based on rank(measure)by row
Prana Nellutla Sep 28, 2017 10:37 AM (in response to Sunny Talwar )Thankyou Sunny I have 12 months so i can define 12 ranks.What is difference between Hrank and Rank?
Can we use gradient coloring here instead of defined solid colors?

Re: Color expression based on rank(measure)by row
Sunny Talwar Sep 28, 2017 10:40 AM (in response to Prana Nellutla)HRank is used for pivoted dimensions in a pivot table and Rank is used in Straight table or unpivoted dimensions. Also, read here:

Re: Color expression based on rank(measure)by row
Prana Nellutla Sep 28, 2017 11:19 AM (in response to Sunny Talwar )Sunny thanks again  the code worked.

Re: Color expression based on rank(measure)by row
Sunny Talwar Sep 28, 2017 11:24 AM (in response to Prana Nellutla)Super





Re: Color expression based on rank(measure)by row
Prana Nellutla Sep 28, 2017 12:50 PM (in response to Prana Nellutla)Sunny when I apply a date filters i think the code is not working? i selected a date range and i see just one col colored.
If no date filter I see color on every cell.
this is my code
If(HRank(Sum([# Applications])) = 1, RGB(221,217,196),
If(HRank(Sum([# Applications])) = 2, RGB(197,217,241),
If(HRank(Sum([# Applications])) = 3, RGB(242,220,219),
If(HRank(Sum([# Applications])) = 4, RGB(235,241,222),
If(HRank(Sum([# Applications])) = 5, RGB(228,223,236),
If(HRank(Sum([# Applications])) = 6, RGB(218,238,243),
If(HRank(Sum([# Applications])) = 7, RGB(250,191,143),
If(HRank(Sum([# Applications])) = 8, RGB(196,215,155),
If(HRank(Sum([# Applications])) = 9, RGB(146,205,220),
If(HRank(Sum([# Applications])) = 10, RGB(230,184,183),
If(HRank(Sum([# Applications])) = 11, RGB(196,189,151),
If(HRank(Sum([# Applications])) = 12, RGB(191,191,191)))))))))))))

Re: Color expression based on rank(measure)by row
Sunny Talwar Sep 28, 2017 12:55 PM (in response to Prana Nellutla)Try this
If(HRank(Sum({1}[# Applications])) = 1, RGB(221,217,196),
If(HRank(Sum({1}[# Applications])) = 2, RGB(197,217,241),
If(HRank(Sum({1}[# Applications])) = 3, RGB(242,220,219),
If(HRank(Sum({1}[# Applications])) = 4, RGB(235,241,222),
If(HRank(Sum({1}[# Applications])) = 5, RGB(228,223,236),
If(HRank(Sum({1}[# Applications])) = 6, RGB(218,238,243),
If(HRank(Sum({1}[# Applications])) = 7, RGB(250,191,143),
If(HRank(Sum({1}[# Applications])) = 8, RGB(196,215,155),
If(HRank(Sum({1}[# Applications])) = 9, RGB(146,205,220),
If(HRank(Sum({1}[# Applications])) = 10, RGB(230,184,183),
If(HRank(Sum({1}[# Applications])) = 11, RGB(196,189,151),
If(HRank(Sum({1}[# Applications])) = 12, RGB(191,191,191)))))))))))))

Re: Color expression based on rank(measure)by row
Prana Nellutla Sep 28, 2017 1:42 PM (in response to Sunny Talwar )


Re: Color expression based on rank(measure)by row
Vishnu Chakravaram Sep 28, 2017 12:57 PM (in response to Prana Nellutla)This will only simplify the nested if's
Pick (
HRank(Sum([# Applications])) , RGB(221,217,196), RGB(197,217,241), ("IN THIS ORDER")
)

Re: Color expression based on rank(measure)by row
Prana Nellutla Sep 28, 2017 1:40 PM (in response to Vishnu Chakravaram)Thanks Vishnu this avoids the confusion on # of braces in nested if stmt.

Re: Color expression based on rank(measure)by row
Vishnu Chakravaram Sep 28, 2017 2:13 PM (in response to Prana Nellutla)Good to know
Also,
Alt(
Pick (
HRank(Sum([# Applications])) , RGB(221,217,196), RGB(197,217,241), ("IN THIS ORDER")
)
, BLACK ())
This should take care of a default color to be applied when there's no output for the Pick to resolve.


