cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bw70316 Member
Member

If statement to turn postive to negative

I have budget, actuals, and remaining columns for revenue. When Actuals exceeds the budget that means it has exceed over 100%. However, the figures still return positive. I want to highlight those figures negatively so that the user knows that they are in the black compared to the rest of the revenue types.

 

I am trying to write an If statement that says is % spent > 100%, SIGN(Sign([Rev Remaining)

 

 

I feel like I am close :

Over Rev = IF ( [% spent] > "100%", Sign([Rev Remaining]))
1 ACCEPTED SOLUTION

Accepted Solutions
bw70316 Member
Member

Re: If statement to turn postive to negative

I think Sign was the wrong DAX formula.

I went with this and got my desired result:

Over Rev = IF ( ([% spent] > 1), -[Abs Rev Remaining], [Abs Rev Remaining])



I guess you can just add a "-" in front of a measure to have the output come out negative.

 

2 REPLIES 2
dedelman_clng New Contributor
New Contributor

Re: If statement to turn postive to negative

If [% spent] is a column or measure that is a decimal type, you don't want to compare against a string ("100%"). 100% is the same as saying 1

 

Over Rev = IF ( [% spent] > 1, Sign([Rev Remaining]))

 

Hope this helps

David

bw70316 Member
Member

Re: If statement to turn postive to negative

I think Sign was the wrong DAX formula.

I went with this and got my desired result:

Over Rev = IF ( ([% spent] > 1), -[Abs Rev Remaining], [Abs Rev Remaining])



I guess you can just add a "-" in front of a measure to have the output come out negative.

 

Helpful resources

Announcements
Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 254 members 2,677 guests
Please welcome our newest community members: