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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bw70316
Helper V
Helper V

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

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.

 

View solution in original post

2 REPLIES 2
dedelman_clng
Community Champion
Community Champion

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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.