Forum Discussion
Time values with text format and conditional background color format required! Help me pls?
- Anonymous2 years ago
Hey, could you give this a try:
HighlightTime =
VAR _time = SELECTEDVALUE('Table'[Column1])
VAR _timeValue = TIMEVALUE(_time)
VAR _highlight =
IF(
_timeValue >= TIME(0,0,0) && _timeValue < TIME(2,0,0),
0, // no color
1 // red color
)
RETURN _highlight - Anonymous2 years ago
Hi Anonymous ,
Anonymous nice method!And here's my solution on cell elements format.
Here is my test data:
1.Create a measure
HighlightTime = VAR _time = TIMEVALUE ( SELECTEDVALUE ( 'Table'[Column1] ) ) VAR _highlight = IF ( _time >= TIME ( 0, 0, 0 ) && _time < TIME ( 2, 0, 0 ), 0, 1 ) RETURN _highlight2.Formatting cells
Go to Format Visual ->Format your visual
->cell elements and apply measure as a function of background color
3.Final output
Best Regards,
Albert He
Hi Anonymous ,
Anonymous nice method!And here's my solution on cell elements format.
Here is my test data:
1.Create a measure
HighlightTime =
VAR _time =
TIMEVALUE ( SELECTEDVALUE ( 'Table'[Column1] ) )
VAR _highlight =
IF ( _time >= TIME ( 0, 0, 0 ) && _time < TIME ( 2, 0, 0 ), 0, 1 )
RETURN
_highlight
2.Formatting cells
Go to Format Visual ->Format your visual
->cell elements and apply measure as a function of background color
3.Final output
Best Regards,
Albert He
- Anonymous2 years agoNot applicable
Thanks! All looks great on the cell formatting too, hopefully this gives the user a solution.