Forum Discussion
Conditional Formatting: Number to Text
I have a column called "Projected Hour Variance" that shows a percentage. I have this on a card visual, but instead of the percentage appearing, I want to show text OR show a red/yellow/green dot.
For example:
If the value is between -10% and 0%, I want text to appear as "Within Budget" OR have a green dot.
If the value is more than 10%, I want text to appear as "Over Budget" OR have a red dot.
How do I do this?
Hi Anonymous ,
Please try this:
Or create a measure:
Measure = var pro = MAX('Table'[Projected Hour Variance]) return IF( pro <=0 && pro >= -0.1,"Within Budget",IF(pro>=0.1,"Over Budget",""))
4 Replies
- Tahreem24
Super User
Anonymous ,
Try a below DAX measure:
Final Output = SWITCH(TRUE(),AND([Projected Hour Variance]>-10,[Projected Hour Variance]<=0),"Within Budget","Over Budget")See this screen shot of expected output. - amitchandak
Super User
Anonymous , You can create a color measure and use UNICHAR to display
example
Color Year = if(FIRSTNONBLANK('Table'[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK('Table'[Year],2014)>2018,"red","yellow"))
refer these two
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692
https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/
- AnonymousNot applicable
How or where do I add these formulas?
- v-xuding-msft
Community Support
Hi Anonymous ,
Please try this:
Or create a measure:
Measure = var pro = MAX('Table'[Projected Hour Variance]) return IF( pro <=0 && pro >= -0.1,"Within Budget",IF(pro>=0.1,"Over Budget",""))