Forum Discussion
Anonymous
4 years agoNot applicable
Anonymous customers
I have a field within my data that represents a true and false value if a customer wants to be anonymous, I need an IF function that would search for the value of this field and replace the customer name to annoymous if the field is true. If not true, then leave customer name.
Any help on this?
Anonymous
you can utilize a measure like this
Measure = MAXX ( ADDCOLUMNS ( ADDCOLUMNS ( 'Table', "X", SWITCH ( TRUE (), 'Table'[Condition] = TRUE (), 1, 0 ) ), "change", SWITCH ( TRUE (), [X] = 1, [name], "anonymous" ) ), [change] )
4 Replies
- amitchandak
Super User
Anonymous ,
a new column
= if([field] = true(), "annoymous ", [Customer])
- AnonymousNot applicable
It's saying that the DAX cannot values of type Text to True/False. Consider using Value or Format.
- smpa01
Community Champion
Anonymous
you can utilize a measure like this
Measure = MAXX ( ADDCOLUMNS ( ADDCOLUMNS ( 'Table', "X", SWITCH ( TRUE (), 'Table'[Condition] = TRUE (), 1, 0 ) ), "change", SWITCH ( TRUE (), [X] = 1, [name], "anonymous" ) ), [change] )- smpa01
Community Champion
Anonymous did you try the above?