Forum Discussion
Olenard
5 years agoHelper III
Function sign
Dear power Bi community i am trying to use the command sign. But the results is strange. Please see below : I excpected the results to be -1 on negative lines. Thank you all
- Anonymous5 years ago
Olenard
If you use SUM(...) when you have a row context, the SUM does not see any row context since it's an aggregator and only works with filter contexts. So, SUM sees ALL ROWS at the same time. Please remove SUM from the formula and it'll then work row by row. Please learn about contexts and how they behave.By the way, SIGN does NOT need a measure: https://dax.guide/sign/
AlB
5 years agoCommunity Champion
Hi Olenard
You are applying the SIGN() function to the SUM of all the elements in the column. Try this instead:
CA Type Line = SIGN( Sales[Net Sales] )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers