Forum Discussion
RSip
2 years agoFrequent Visitor
Repeating values based on condition in DAX
Greetings, I have this problem which I am unable to solve by myself: I have a table which holds the information of different test subjects, the data is grouped, ranked and sorted. The column ...
gmsamborn
Super User
2 years agoHi RSip
I took another look at [NEWCOLUMN] and realized that it will ALWAYS equal 'Table'[strength35].
In the first line, you set str35 to 'Table'[strength35] meaning that the variable won't change. Also, there is nothing in your DAX that would change the context, that would change the returned value for 'Table'[strength35] in any way.
NEWCOLUMN =
VAR _str35 = 'Table'[strength35]
VAR _str15 = 'Table'[strength15]
VAR _MINIMUM = _str35 * 0.63
VAR _MAXIMUM = _str35 * 1.37
VAR _REDLINE = 40 + ( 1.48 * _str35 )
VAR _TEST =
IF (
'Table'[RANK] < 35,
BLANK (),
IF (
'Table'[RANK] = 35,
'Table'[strength35],
IF (
_MINIMUM <= _str15
&& _MAXIMUM >= _str15
&& _REDLINE <= 'Table'[AVERAGE],
_str35,
'Table'[strength35]
)
)
)
RETURN
_str35
Let me know if you have any questions.