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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.