Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

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:

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

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

    (1) This is my test data. 

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

     

     

    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. 

4 Replies

    • Anonymous's avatar
      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.

       

      • Ritaf1983's avatar
        Ritaf1983
        Super User

        Hi Anonymous 

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

  • Anonymous's avatar
    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. 

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

     

     

    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.