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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Percentage Difference Quick Measure with Negative Values

Hi all,

 

I'm trying to calculate percentage difference between yesterday's margin and today's margin. Screenshot below of current quick measure (ignore red underline, changed table name for screenshot). For example, yesterday's margin was $500, and today's margin is $600. The measure correctly returns 20%.

 

However, the measure doesn't seem to work correctly if there is a negative value. For example, yesterday's margin was -$1726, and today's margin is $1217. The measure is returning -170.5% instead of 170.5%. I understand why this is happening, but I'm not sure how to edit the syntax to account for negative values.

 

Originally, I created a nested if calculated column that used absolute values to account for negatives, but the total row on my table was adding all the % Change in Margin values instead of calculating one % Change in Margin for the table.

 

PowerUp_0-1626367487070.png

 

Let me know if I can provide any other details. Thanks for your help!

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi,  @Anonymous 

It works well on my side.

1.png

Please make sure [Yesterday’s Margin] and [Today’s Margin] are t actual columns or calculated columns in the table .

If they are measures, it is recommended to convert them into calculated columns before you using  quick measure.

 

If it doesn't work ,please share your sample file and expected result for further research.

 

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks for your reply! Technically, I'm looking for it to return +170.5%, not negative.

Anonymous
Not applicable

Hi @Anonymous @v-easonf-msft There's an issue when the base value is negative and the compared value is positive. In general, if the numerator indicates the direction, i.e. increase or decrease, then the denominator must have the absolute value. I am getting around the error in quick measure formula by adding ABS(__BASELINE_VALUE). 

--Thus changing

RETURN
DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE; __BASELINE_VALUE)

--to

RETURN
DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE; ABS(__BASELINE_VALUE))

 

check my reply to post: https://community.powerbi.com/t5/Desktop/Quick-measure-Percentage-difference/m-p/204192

v-easonf-msft
Community Support
Community Support

Hi,  @Anonymous 

It works well on my side.

1.png

Please make sure [Yesterday’s Margin] and [Today’s Margin] are t actual columns or calculated columns in the table .

If they are measures, it is recommended to convert them into calculated columns before you using  quick measure.

 

If it doesn't work ,please share your sample file and expected result for further research.

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.