Forum Discussion

js124's avatar
js124
Frequent Visitor
6 years ago

Matrix table question

I've created a matrix table showing Media Division % for 2018 and 2019: 

 

Instead of a Totals column, which is adding 2018 and 2019 percentages together, I want to have a column on the right showing the variance between 2018 and 2019 percentages.

 

Is there a way to achieve this?

 

 

5 Replies

  • Nathaniel_C's avatar
    Nathaniel_C
    Community Champion

    Hi js124 ,

     

    Create a column in PQ or PBI and use your variance formula, then drop the column into the matrix. Or create a  measure such as DIVIDE(2018-2019, 2018)

    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
    Nathaniel

    • js124's avatar
      js124
      Frequent Visitor

      Hi Nathaniel_C ,

       

      Unfortunately it doesn't like it will be as simple as the solution you mentioned. 

       

      I have the columns filtered by Year for 2018 and 2019, with the values being displayed at a percentage of the column totals:

       

        

      And for clarification, I'm just looking for the difference between 2018 and 2019. So if the percentage of digital was 18.70% in 2018 and 16.96% in 2019, I'll like a column in the right to display as -1.74%.

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi

         

        I would make a measure like the one below (you should probably make something more dynamic on the year filtering to make it apply in 2020):

        value measure = 
        
            IF(
                ISFILTERED('Table'[Year]);
                SUM('Table'[Value]) / CALCULATE( SUM( 'Table'[Value]); ALLEXCEPT( 'Table'; 'Table'[Year]));
                CALCULATE( SUM('Table'[Value]); 'Table'[Year] = 2019) - CALCULATE( SUM( 'Table'[Value]); 'Table'[Year] = 2018)
            )

        If this works then please mark it as the accepted solution.