Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Olenard
Helper III
Helper III

Function sign

Dear power Bi community

 

i am trying to use the command sign. But the results is strange. Please see below :

 

D9AD6509-6FD1-44A7-BFF5-A363D3B65907.png

I excpected the results to be -1 on negative lines.

 

Thank you all

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@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/

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

@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/

Hi @Anonymous ,
I think I get it. Should I use Sumx then ?

Olenard
Helper III
Helper III

Hi,

 

but Am I not in a row contexte. Using only Sales(net sales) this does not work. The Dax formula expects a measure

@Olenard 

Then you need to explain what you need better. You show a calculated column and you talk about wanting the result for each row, so this is confusing/contradictory  information if you do not have a row context. IS it a measure what you need? If so, what is the measure supposed to do exactly?

 

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 

 

SU18_powerbi_badge

@AlB 

Thank you for your reply.

 

My sentence was not clear.

I am in a row context. Since I am in a row context I expected the formula to take the sign of the sales column.

 

Regarding the measure, the thing was that the function sign does not accept column as a reference, only measure.

 

how do i indicate in this column that I only want the sign of the row.

@Olenard 

Sorry, I still do not understand what the problem/question is.

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

AlB
Super User
Super User

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 

SU18_powerbi_badge

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.