Forum Discussion
help needed - difference btw columns
- Anonymous1 year ago
Try using the following DAX formula.
Negative vari = var _lyop = CALCULATE(SUM('Table 2'[Rev]), 'Table 2'[Type] = "LYOP") var _op = CALCULATE(SUM('Table 2'[Rev]), 'Table 2'[Type] = "OP") RETURN IF(SELECTEDVALUE('Table 2'[Type]) = "OP", _lyop - _op, BLANK())Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 1 year ago
no, what I mean is I would like to see the difference OP minus LYOP in a format that either negative or positive based on figures- not only negative ones or not in absolute form. Is it clear?
Hi z29n ,
After setting the wrap, you need to drag the LYOP right border to hide the absolute data columns.
If you want to get negative numbers, you don’t use abs function.
Absolut =
var _lyop = CALCULATE(SUM('Table 2'[Rev]), 'Table 2'[Type] = "LYOP")
var _op = CALCULATE(SUM('Table 2'[Rev]), 'Table 2'[Type] = "OP")
RETURN
IF(SELECTEDVALUE('Table 2'[Type]) = "OP", _lyop - _op, BLANK())
//IF(SELECTEDVALUE('Table 2'[Type]) = "OP", ABS(_lyop - _op), BLANK())
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
thanks a lot, now one more thing: I would like to have negative variances as well instead of absolute figures. Can you help me on that as well?
thanks in advance..
- Anonymous1 year agoNot applicable
Try using the following DAX formula.
Negative vari = var _lyop = CALCULATE(SUM('Table 2'[Rev]), 'Table 2'[Type] = "LYOP") var _op = CALCULATE(SUM('Table 2'[Rev]), 'Table 2'[Type] = "OP") RETURN IF(SELECTEDVALUE('Table 2'[Type]) = "OP", _lyop - _op, BLANK())Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- z29n1 year agoRegular Visitor
no, what I mean is I would like to see the difference OP minus LYOP in a format that either negative or positive based on figures- not only negative ones or not in absolute form. Is it clear?