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
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
Super User
Super User

@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
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.