Forum Discussion
Condtional Formatting Issue
Why does Power BI not let me conditional format something? It blurs out the metric I want to conditionally format.
10 Replies
- TomMartensSuper User
Hey Anonymous,
can you please explain what you mean by "conditional format" the measure.
Do you want to use this measure to control the background color inside a table visual or do you want to control the background based on the values of the above measure.
What visual are using and what conditional formatting are you going to use?
Regards,
Tom
- AnonymousNot applicable
Hello Tom! So what I did was create a calculation which will show the average amount of time it takes for folks to answer a phone call:
Avg Ans Time (Mins) =VAR hours =ROUNDDOWN( 'CallData'[AvgAnsTime] / 3600,0)VAR minutes =ROUNDDOWN( MOD( 'CallData'[AvgAnsTime], 3600) / 60, 0)VAR seconds =INT( MOD ('CallData'[AvgAnsTime], 60) )RETURNFORMAT(hours, "0") & ":"& FORMAT(minutes, "00") & ":"& FORMAT(seconds, "00")With the values of the calculation, I am looking to place them in a table which helps show the amount of time it will take by the time of the day and the date, and I am looking to conditionally format values that are above 15 minutes long.- TomMartensSuper User
Hey Anonymous ,
this part of the measure
... FORMAT(hours, "0") & ":" & FORMAT(minutes, "00") & ":" & FORMAT(seconds, "00")Turns the result into a string for this reason you can't the measue to trigger conditional formatting.
You can do the following, create a second measure that represents the time value as a decimal.
Then you can use Conditional formatting based on Rules:
Select the measure that represents the time as a decimal value and create formatting rules accordingly.
Hopefully, this provides what you are looking for and helps to tackle your challenge.
Regards,
Tom
- TomMartensSuper User
Hey Anonymous ,
you need two measures one that formats the value to your liking "0:00:00" (the string).
Then create a 2nd measure that converts the text value into a decimal (Solved: DAX function HH:MM:SS to Decimal Format - Microsoft Power BI Community). Then use the 2nd measure to add conditional formatting to the first measure.
Regards,
Tom
- AnonymousNot applicable
Hi! TomMartens
So I did
= FORMAT('CallData'[AvgTalkTime(Mins)], "Decimal Number")
And it stayed the exact same as Text and blurs out the 2nd measure for conditional formatting
- TomMartensSuper User
Hey Anonymous ,
this converts a text like "h:mm:ss" into a decimal of datatype DOUBLE:
Time to Decimal = Convert( TIMEVALUE("0:15:00") , DOUBLE )Regards,Tom