Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Help with Dividing two categories in a single data column

Please see screenshot.  This is a matrix table.  I wish to divide 'engaged' by 'reached'.  However these are categories and all share the same 'value' column.  So how do I do this?  i.e. the logic needs to be division where value=engaged / where value = reached.  Please help! Thanks  

  • Hi Anonymous ,

     

    You need to create a measure with the following syntax:

     

    % Engaged/reached CALCULATE(SUM(Table1[Value]);Table1[Type] = "Engaged")/ CALCULATE(SUM(Table1[Value]);Table1[Type] = "Reached")

    Regards,

    MFelix

  • Anonymous's avatar
    Anonymous
    7 years ago

    Thanks, this got me on the right track.  I had to insert apostropes though around table names and also replace your semi colons with commas.  So the correct result was:

    ER% = CALCULATE(SUM('Data 2019'[Value]),'Data 2019'[KPI] = "Engaged")/ CALCULATE(SUM('Data 2019'[Value]),'Data 2019'[KPI] = "Reached") 
     

     

  • MFelix's avatar
    MFelix
    7 years ago

    Hi Anonymous ,

     

    You must reduce the size of the columns you want to hide, be carefull to turn off word wrap on columns title and values.

     

    This is a workaround but is the way to achieve your goal.

     

    Regards,

    MFelix

6 Replies

  • Hi Anonymous ,

     

    You need to create a measure with the following syntax:

     

    % Engaged/reached CALCULATE(SUM(Table1[Value]);Table1[Type] = "Engaged")/ CALCULATE(SUM(Table1[Value]);Table1[Type] = "Reached")

    Regards,

    MFelix

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks, this got me on the right track.  I had to insert apostropes though around table names and also replace your semi colons with commas.  So the correct result was:

      ER% = CALCULATE(SUM('Data 2019'[Value]),'Data 2019'[KPI] = "Engaged")/ CALCULATE(SUM('Data 2019'[Value]),'Data 2019'[KPI] = "Reached") 
       

       

      • MFelix's avatar
        MFelix
        Icon for Super User rankSuper User

        Hi Anonymous ,

         

        That question about the commas and the names of the tables as to do with the regional settings on the computer it's a normla thing.

         

        Glad I could help.

         

        Regards,

        MFelix