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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Tun
Regular Visitor

how can i add variance in a two layered matrix table

Tun_0-1756844637140.png

Hi all,

i have a two layered matrix table and i want to add variance in current month, ytd and ye. 
So for example, in the current month, i would like to add variance for actual - budget, actual-forecast, ytd would be actual - budget. I have tried several methods, but was not successful. Any help?

1 ACCEPTED SOLUTION
v-ssriganesh
Community Support
Community Support

Hello @Tun,

I have reproduced your scenario in Power BI Desktop and was able to achieve the expected output as per your requirement. I created variance measures for:

  • Current Month: Actual – Budget, Actual – Forecast
  • YTD: Actual – Budget
  • YE: Actual – Budget

This gave me the correct results in the matrix visual:

vssriganesh_0-1756893209549.png

For your reference, I am attaching a sample .pbix file that demonstrates the full solution. You can review and adapt the same logic to your own model.

 

Best regards,
Ganesh Singamshetty.

View solution in original post

7 REPLIES 7
v-ssriganesh
Community Support
Community Support

Hello @Tun

Could you please confirm if your query has been resolved by the provided solutions? This would be helpful for other members who may encounter similar issues.

 

Thank you for being part of the Microsoft Fabric Community.

 

v-ssriganesh
Community Support
Community Support

Hello @Tun,

Hope everything’s going great with you. Just checking in has the issue been resolved or are you still running into problems? Sharing an update can really help others facing the same thing.

Thank you.

v-ssriganesh
Community Support
Community Support

Hello @Tun,

We hope you're doing well. Could you please confirm whether your issue has been resolved or if you're still facing challenges? Your update will be valuable to the community and may assist others with similar concerns.

Thank you

v-ssriganesh
Community Support
Community Support

Hello @Tun,

I have reproduced your scenario in Power BI Desktop and was able to achieve the expected output as per your requirement. I created variance measures for:

  • Current Month: Actual – Budget, Actual – Forecast
  • YTD: Actual – Budget
  • YE: Actual – Budget

This gave me the correct results in the matrix visual:

vssriganesh_0-1756893209549.png

For your reference, I am attaching a sample .pbix file that demonstrates the full solution. You can review and adapt the same logic to your own model.

 

Best regards,
Ganesh Singamshetty.

Shahid12523
Community Champion
Community Champion

Create variance measures in DAX, e.g.:

Var_CM_Act_Budget = [Actual_CM] - [Budget_CM]
Var_CM_Act_Forecast = [Actual_CM] - [Forecast_CM]
Var_YTD_Act_Budget = [Actual_YTD] - [Budget_YTD]
Var_YE_Act_Budget = [Actual_YE] - [Budget_YE]


Add these measures into your matrix right after Actual (under Current Month, YTD, YE).

(Better) Use a Calculation Group in Tabular Editor → add Budget, Forecast, Actual, Variance as calc items → Power BI auto-layers them neatly.

Shahed Shaikh
Aburar_123
Solution Supplier
Solution Supplier

Hi @Tun ,

you can write a measure as below,

Variance = if(max('Table'[category])="Current Month", sum(actual)-sum(forecast),

if(max('Table'[category])="YTD", sum(actual)-sum(budget)

))

 

Thanks.

GeraldGEmerick
Impactful Individual
Impactful Individual

@Tun Are the columns in the second row measures or columns? If they are measures, you should be able to construct a measure like the following and add it as a value.

Variance = [actual] - [budget]

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors