Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Conditional Format % using FORMAT() function

Hi All,


I have a dax measure using a SWITCH() statement. Sometimes the result will be a whole number and sometimes a percent. I am using the FORMAT() function when obtaining a %.


The only issue is when applying conditional formatting to the measure, it is not applied to any result diplaying x%. I am guessing becasue the format function is displaying text not a number?


Does anyone know a solution or work around for this?

Community Support
Community Support

Hi @pbi_baller 

You can refer to the following example

Sample data 



Measure 1

Measure 3 = IF(SELECTEDVALUE('Table'[Column2])>=0.5&&SELECTEDVALUE('Table'[Column2])<=2,SELECTEDVALUE('Table'[Column2])*100&"%",SUM('Table'[Column2]))

Then create a formatter measure

Measure 4 = var a=IF(CONTAINSSTRING([Measure 3],"%"),CONVERT(LEFT([Measure 3],SEARCH("%",[Measure 3],1,BLANK())-1),DOUBLE)/100,[Measure 3])
return IF(a>=10,"red",IF(a>0.5&&a<2,"blue","green"))

Then put the measure to the conditional formatting




Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


Helpful resources

Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors