Forum Discussion
Repeating values based on condition in DAX
Hi RSip
I tested your problem and found some issues.
For the result you want, "str15" matches the condition you set in dax, i.e. a data rank of 38.
According to your description, NEWCOLUMN should output "835" to be logical.
However, you want it to output its own value "str35".
This is what I don't understand. Do you have another judgment condition present?
It would be best to provide the pbix file if you can and be careful to remove sensitive data.
This will allow me to help you in more detail.
Regards,
Nono Chen
I apologise for the late reply. I noticed that the formula I attached was not the one I used in my PowerBi, this is what I used:
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
In a row of rank 38, while 'strength35' and 'strength15' almost match, MIN value from row ranked 35 is 5.26 which is higher than 4.96 'strength15' value in row ranked 38. What I am trying to achieve in this table is to find a value, calculate minimum, maximum and redline boundries for it and use these values until the boundries are crossed, then get a new value and calculate its boundries and so on.
I do not have another judgement condition present.
In a day or two I should be able to create a pbix file with dummy data.