Forum Discussion
If HasOneValue with &&& Return statement
- 2 years ago
Anonymous, please try changing the DAX expression of your [Masked Name1] measure to this:
Masked Name1 = VAR ovAttendanceValue = HASONEVALUE(Table1[Attendance Percent]) VAR AttendanceValue = VALUES(Table1[Attendance Percent]) VAR GetName = VALUES(Table1[Student Full Name]) RETURN IF( ovAttendanceValue, IF( AttendanceValue < 0.8 && AttendanceValue > 0, "*", GetName ) )The error you were getting was because you were trying to pass in an expression to the VALUES function, but the VALUES function can only take a table or column. You were also trying to pass in more than one paramter when VALUES tables just 1 paramter.
Anonymous, please try changing the DAX expression of your [Masked Name1] measure to this:
Masked Name1 =
VAR ovAttendanceValue = HASONEVALUE(Table1[Attendance Percent])
VAR AttendanceValue = VALUES(Table1[Attendance Percent])
VAR GetName = VALUES(Table1[Student Full Name])
RETURN
IF(
ovAttendanceValue,
IF(
AttendanceValue < 0.8 && AttendanceValue > 0, "*", GetName
)
)
The error you were getting was because you were trying to pass in an expression to the VALUES function, but the VALUES function can only take a table or column. You were also trying to pass in more than one paramter when VALUES tables just 1 paramter.
- Anonymous2 years agoNot applicable
EylesIT - thank you!
I see what you mean.
By using the nested IF statement, I could maintain the parameter rules and produce the intended output.
The if statement now has the parameter to choose either the hasonevalue or the alternative values.
Brilliant.
Thank you again.