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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
joe231
Frequent Visitor

HELP with Negative Return Values

Hi All -

 

in a measure column, I am Trying to calculate %difference between 2 columns (Result 1 column) that results into Negative values. I want the negative values to positive and keep the positive values as positive. 

 

I simply could  mulitply the column to -100 but it also affects positive values and turns them into negative.

 

joe231_0-1661970721942.png

 

I was hoping  an "if" modification in this formula

 

joe231_1-1661971019912.png

 

 

1 ACCEPTED SOLUTION
Adescrit
Impactful Individual
Impactful Individual

Hi @joe231 ,

 

How about this:

% Difference = 
VAR __Measure_Value = Data[Result2] 
VAR __Baseline_Value = Data[Result1]
VAR __Calculation = DIVIDE( __Measure_Value - __Baseline_Value , __Baseline_Value )
RETURN
    IF( __Calculation < 0, __Calculation * -1, __Calculation )

Did I answer your question? Mark my post as a solution!
My LinkedIn

View solution in original post

2 REPLIES 2
v-yadongf-msft
Community Support
Community Support

Hi @joe231 ,

 

Has your problem been solved? If solved, please consider Accept it as the solution to help the other members find it more quickly.

 

Best regards,

Yadong Fang

Adescrit
Impactful Individual
Impactful Individual

Hi @joe231 ,

 

How about this:

% Difference = 
VAR __Measure_Value = Data[Result2] 
VAR __Baseline_Value = Data[Result1]
VAR __Calculation = DIVIDE( __Measure_Value - __Baseline_Value , __Baseline_Value )
RETURN
    IF( __Calculation < 0, __Calculation * -1, __Calculation )

Did I answer your question? Mark my post as a solution!
My LinkedIn

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.