Forum Discussion

Johan-MTM's avatar
Johan-MTM
Icon for Helper III rankHelper III
2 years ago
Solved

Add a column for row totals

Hi,
How do I add a column that show a total for each row?

 

  • Total = SUMX(q2, q2[Antal lan lantagare under 18]+q2[Antal lan vuxna lantagare]+q2[Antal lán bibliotek]+q2[Antal lán TBK]) 

     

12 Replies

  • eliasayyy's avatar
    eliasayyy
    Icon for Memorable Member rankMemorable Member

    hello Johan-MTM either try using a matrix table or create a new measure that sums up all your measures and name it total

  • How would the DAX look like if I want to create a new measure?

    • ChiragGarg2512's avatar
      ChiragGarg2512
      Icon for Solution Sage rankSolution Sage

      Total = SUMX(q2, q2[Antal lan lantagare under 18]+q2[Antal lan vuxna lantagare]+q2[Antal lán bibliotek]+q2[Antal lán TBK]) 

       

      • Johan-MTM's avatar
        Johan-MTM
        Icon for Helper III rankHelper III

        Sorry ChiragGarg2512 , I didn't see your reply before I posted my question!

        I tried a new measure with your sugestion but got an error:

         

  • Johan-MTM , If the simple objective is to have a column that is the sum data in each row. For ex, the new column value for "Angereds bibliotek" is 34, then

    Total = q2[Antal lan lantagare under 18]+q2[Antal lan vuxna lantagare]+q2[Antal lán bibliotek]+q2[Antal lán TBK]

    should work.

     

    If a measure is required,

    Total = SUMX(q2, q2[Antal lan lantagare under 18]+q2[Antal lan vuxna lantagare]+q2[Antal lán bibliotek]+q2[Antal lán TBK]) 
    should do the trick.