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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to find the variance from two table using total value?

Hi Everyone,

 

I am facing an issue you guys can help? Your help would be much appreciated.

 

Scenario:

I have two tables and in both tables, I have enabled the total. My requirement is I want to create a new table that says "Variance" where I will have two measures one is [ Table one Total] - [ Table two total] let's say " All total" and another measure is [All total] / [ Table two total] lets say " Total %". How could I create this measure so that whenever I change anything in both tables using the slicer it changes in the variance table also?

 

Image of Two Tables:

 

Screenshot 2023-12-12 183222.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1702610775011.pngvtangjiemsft_1-1702610794099.png

(2) We can create measures. 

TotalTable1 = SUM('Table (1)'[value])
TotalTable2 = CALCULATE(SUM('Table (2)'[value]),FILTER(ALLSELECTED('Table (2)'),'Table (2)'[type]=MAX('Table (1)'[type]) && 'Table (2)'[id]=MAX('Table (1)'[id])))
AllTotal = [TotalTable1] - [TotalTable2]
TotalPercent = DIVIDE([AllTotal], [TotalTable2], 0)

(3) Then the result is as follows.

vtangjiemsft_2-1702610934403.pngvtangjiemsft_3-1702610957685.png

 

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1702610775011.pngvtangjiemsft_1-1702610794099.png

(2) We can create measures. 

TotalTable1 = SUM('Table (1)'[value])
TotalTable2 = CALCULATE(SUM('Table (2)'[value]),FILTER(ALLSELECTED('Table (2)'),'Table (2)'[type]=MAX('Table (1)'[type]) && 'Table (2)'[id]=MAX('Table (1)'[id])))
AllTotal = [TotalTable1] - [TotalTable2]
TotalPercent = DIVIDE([AllTotal], [TotalTable2], 0)

(3) Then the result is as follows.

vtangjiemsft_2-1702610934403.pngvtangjiemsft_3-1702610957685.png

 

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Ritaf1983
Super User
Super User

Hi @Anonymous 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Anonymous
Not applicable

Hi @Ritaf1983 Please check the dummy file I have created.

 

** Here I am using a financial matrix. 

 

My requirement is to create another matrix where I need two columns [first matrix total] - [ second matrix total] and another column is ([first matrix total] - [ second matrix total])/[ second matrix total].

 

In the file, you can see two slicers one timeline-1 interacts with the first matrix, and timeline-2 interacts with the second matrix.

 

Please help I am new to Power BI. Please let me know if you have any doubts about the scenario.

 

***I am not able to attach the .Pbix file. Not getting the option.

 

Hi @Anonymous 

You can save the file on one drive or another and share the link with public access.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.