let me share a scenario here:
When I select any observation on a table on left, on the right side, it displays the comment that was submitted by the client (and its being pulled from a different table). I have used the following DAX for that.
Selected Survey Comment: = IF(HASONEVALUE(‘Sentiment Fact’[Clean Comments]),VALUES(‘Sentiment Fact’[Clean Comments]), “Client Did not Submit Any Feedback”)
It works fine until here.
To these comments I added icons using DAX under custom formatting. Here is the DAX I wrote.
SentementIcons =
VAR SScore= VALUES(‘Sentiment Fact’[Sentement Score])
Return
SWITCH(TRUE(),
SScore < 0.45, “SymbolLow”,
SScore < 0.6, “SymbolMedium”,
SScore <= 1, “SymbolHigh”,
SScore == BLANK(), " "
)
The icons are being assigned based on sentiment score column in the table from where comments are being fetched.
It all works fine as long as I have a selection. the moment I unselect an observation, I get the following error
I attempted to fixing the DAX with following changes , but that’s incorrect as well.
SentementIcons1 =
VAR SScore= VALUES(‘Sentiment Fact’[Sentement Score])
VAR Result =
SWITCH(TRUE(),
SScore < 0.45, “SymbolLow”,
SScore < 0.6, “SymbolMedium”,
SScore <= 1, “SymbolHigh”,
SScore == BLANK(), " "
)
Return
IF(HASONEVALUE(‘Sentiment Fact’[Sentement Score]),Result," ")
I am getting what I need when I have a selection on the table in left, that is to show a comment on the right.
The problem is when there is no selection. Any suggestions on how I Can fix this please -
If there is no selection, there should be no icon.