Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone, i'm trying to add a column that checks whether the values of the two columns before are the same or not, and returns a tick or a warning symbol, the expression in the column is the following:
=if([Field1]=[Field2], '✔', if(Upper(trim([Field1]))=Upper(trim([Field2)), '⚠', '✖'))
The problem is that it doesn't work when both columns are null on that row and it returns a null value, while i would like to return a "✖". I attach a screenshot of the 3 columns:
What is strange to me is that the same column has the exact same expression for the color of the text (just switching the symbols with color codes) and that seems to work fine. Moreover when the column is created as a measure and not as a dimension the problem disappears, but i need to be able to select those symbols.
Have you got any idea on how to solve this problem?
My image is from a table, and it appears to be working. Perhaps in your scenario, the table row has no matching rows for whichever table Field1 and Field2 are from? I didn't test that but fields/values that are outright missing can sometimes cause behavior that is not the same as "regular" nulls.
I wasn't able to replicate what you're describing. This seems to work fine with a basic inline load, regardless of whether or not I use the A dimension in my table.
Yes, i cannot understand why in that table it is not working
My image is from a table, and it appears to be working. Perhaps in your scenario, the table row has no matching rows for whichever table Field1 and Field2 are from? I didn't test that but fields/values that are outright missing can sometimes cause behavior that is not the same as "regular" nulls.
HI !
Had you tried adding a condition to your 'if' statement with the isnull() function?
Btw, if those columns comes from a same table in the data model, you could try creating that sort of flag in the script instead.
Thanks @Or, the problem seemed to be that data weren't coming from the same table and rows werent'matching.