Forum Discussion
Repeating values based on condition in DAX
Hi RSip
I imported your data and tried to create your NEWCOLUMN.
I noticed that you were using MIN and MAX as variable names. This isn't allowed because they are reserved keywords.
I'm stuck on determining what 'esama_deviacija' is. Because it isn't enclosed in [ and ], rules out it being a measure or column. The only things I can think of are a) a variable name you haven't defined or b) a table in which case you would have to refer to a column.
Can you explain 'esama_deviacija'?
I apologise for late reply. 'esama_deviacija' is a variable name that I used in my PowerBi file, that I mistakenly did not rename for this example. 'esama_deviacija' should have been named str35. This should work:
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(desc)] < 35,
BLANK (),
IF (
table[Rank(desc)] = 35,
table[strength35],
IF (
MIN <= str15
&& MAX >= str15
&& REDLINE <= table[AVERAGE],
str35,
table[strength35]
)
)
)
RETURN
TEST
Hopefuly this will clear up things.