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
mardusd
New Member

Calculate variance between 2 rows in matrix

Hi Everyone,

I have a simple Matrix, but need to calculate Varaince between 2 Rows per month on the matrix.

mardusd_0-1605513555096.png

I created the below:

ConvAmount % difference from Potential Collections =
VAR __BASELINE_VALUE =
    CALCULATE(
        SUM('CRM'[ConvAmount]),
        'CRM'[Heading] IN { "Potential Collections" }
    )
VAR __MEASURE_VALUE =
CALCULATE(
        SUM('CRM'[ConvAmount]),
        'CRM'[Heading] IN { "Actual Collections" }
)
RETURN
    DIVIDE(__MEASURE_VALUE - __BASELINE_VALUE, __BASELINE_VALUE)


The result is however not per month, but only the totals of the rows are used in the calculation. How can I calculate per month?
3 REPLIES 3
amitchandak
Super User
Super User

@mardusd , this formula seems correct. where you have used this.

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

The major issue is it is not grouping per month, it only uses the total and does the calculation as per the total

 

@mardusd What visual is the measure put in? Is there any month filter in its calculation context? Can you please show a screenshot of the current result and expected result?

 

Best Regards,
Community Support Team _ Jing Zhang

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.