Forum Discussion
Conditional formatting - top 3 clustered column chart
- 4 years ago
Hi Anonymous ,
The switch statement is the way to go, but need a rank column to make it work.
This thread details a few ways to go about ranking: https://community.powerbi.com/t5/Desktop/Ranking-a-column-in-a-table/td-p/1436672
I followed the index column within power query and called it 'Descending Rank' and then used the following measures:
Rank = SELECTEDVALUE('Top 3'[Descending Rank])
Colouringtop3 =
var firstplace = [Rank] = 1
var secondplace = [Rank] = 2
var thirdplace = [Rank] = 3
var result = SWITCH(
TRUE(),
firstplace, "Gold",
secondplace, "Silver",
thirdplace, "Brown", "Black")
return
resultI hope this solves your problem and if it does please mark it as a solution!
Hi Anonymous ,
The switch statement is the way to go, but need a rank column to make it work.
This thread details a few ways to go about ranking: https://community.powerbi.com/t5/Desktop/Ranking-a-column-in-a-table/td-p/1436672
I followed the index column within power query and called it 'Descending Rank' and then used the following measures:
Rank = SELECTEDVALUE('Top 3'[Descending Rank])
Colouringtop3 =
var firstplace = [Rank] = 1
var secondplace = [Rank] = 2
var thirdplace = [Rank] = 3
var result = SWITCH(
TRUE(),
firstplace, "Gold",
secondplace, "Silver",
thirdplace, "Brown", "Black")
return
result
I hope this solves your problem and if it does please mark it as a solution!