Forum Discussion

SirBI's avatar
SirBI
Frequent Visitor
3 years ago
Solved

Hide Title when icon is blank

I have created a trend icon, see code below. 

 

I added this into a "card" and added a title. 

 

I need to hide the title when the "NuteralIcon" is displayed, which is blank. 

 

Any help on how to do this?

 

FailTrendIcon =
var PostiveIcon = "▲"
var NegativeIcon = "▼"
var NuteralIcon = " "
var Result = switch(
    true(),
    ds_failrate[FailRateCompare] >= .02, PostiveIcon,
    abs(ds_failrate[FailRateCompare]) >= 0 && abs(ds_failrate[FailRateCompare]) < .02, NuteralIcon,
    ds_failrate[FailRateCompare] <= -.02,NegativeIcon)
Return Result
  • Create another measure for the card title that has the same logic but returns BLANK() for the second condition.

     

    By the way,

     abs(ds_failrate[FailRateCompare]) >= 0

    is meaningless as it will always be true.

1 Reply

  • Create another measure for the card title that has the same logic but returns BLANK() for the second condition.

     

    By the way,

     abs(ds_failrate[FailRateCompare]) >= 0

    is meaningless as it will always be true.