Forum Discussion
Date based conditional icons
I have a data like this
I want to show icons on table based on the dates. so up to 24th may 2022 I want to show yellow color icon and whenever the day 25th may 2022 come then I want to show green color icon and if date pass then I want to show red color icon. How to do this in power bi
Anonymous ,
Switch(True(),
Max(Table[billing date]) <= date(2022,05,14), "Yellow",
Max(Table[billing date]) <= Max(Table[system date]) , "Green", //today() in case you need current date
// add other
)
Same way create icons or use any icon using unichar
icon = unichar(9898)
Use this measure and use conditional formatting using field value option
3 Replies
- amitchandakSuper User
Anonymous , You need create a color measure and icon measure. For Icon measure you can use unichar of your choice
example
/////Arrow
Arrow =
var _change =[Net Sales YTD]-[Net Sales LYTD]
return
SWITCH (
TRUE(),
_change > 0, UNICHAR(9650),
_change = 0, UNICHAR(9654),
_change < 0, UNICHAR(9660)
)
/////Arrow Color
Arrow color =
var _change =[Net Sales YTD]-[Net Sales LYTD]
return
SWITCH (
TRUE(),
_change > 0, "green",
_change = 0, "blue",
_change < 0, "red"
)https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692
https://exceleratorbi.com.au/dax-unichar-function-power-bi/- AnonymousNot applicable
Actually I need icons based on billing date so upto 24th may 2022 I want to show it in yellow color only and whenever the system date matches to billing date then I want to show green and whenever system date pass billing date then i want to show red
- amitchandakSuper User
Anonymous ,
Switch(True(),
Max(Table[billing date]) <= date(2022,05,14), "Yellow",
Max(Table[billing date]) <= Max(Table[system date]) , "Green", //today() in case you need current date
// add other
)
Same way create icons or use any icon using unichar
icon = unichar(9898)
Use this measure and use conditional formatting using field value option