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
Anonymous
Not applicable

Negative to positive gains showing as a negative variance in Matrix

Hi All,

I'm trying to finish up a detailed financial report but i'm running into some inconsistencies with the variance cells. 
Seems to me that BI is calculating all the values as positives even when they are negative values. 

Positive to positive changes work perfectly but once a negative value is dropped in it shows opposite variances. 

As seen in the clip below -53,562.63 to +13,346.04 shouldn't be a negative percentage as that is a positive gain. Yet it shows it as a -125% loss. Same as -1,011.12 to -175,585.34 is a loss but yet shows a positive percentage gain of 17,265%


Here is the measure i'm using to calculate this:

Prior Month Variance =
IF(
    ISFILTERED('Finance'[Posting Date.Month]),
    VAR __PREV_MONTH =
        CALCULATE(
            SUM('Finance'[Current Total]),
            DATEADD('Finance'[Posting Date.Month].[Date], -1, MONTH)
        )
    RETURN
        DIVIDE(SUM('Finance'[Current Total]) - __PREV_MONTH, __PREV_MONTH)
)


Capture3.JPG

Thank You For Your Assistance,
Ray Lo the Data Bro

1 REPLY 1
Anonymous
Not applicable

@Anonymous - When you divide a positive and negative number, it is negative. There needs to be a business rule as to how you want to handle these scenarios. Then you can incorporate the logic into your calculation.

Hope This Helps,

Nathan

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.