Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Calculate multiple columns

Hello Experts,

 

I am new to DAX queries. I am trying to calculate following fields, but unable to do so.

 

Column AColumn BColumn CColumn D
85393021

 

my goal is to calculate like this,

 

ColumnA + Column B + Columm C / Column D

 

Would be great help if you could help me with this

 

regards

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hello Ankit,

     

    Thanks for your response. I was able to derive accrurate figure based on the script mentioned below. Not sure why.

     

    Instead, i wrote below one and got the correct answer

     

    divide(Table[Column1] + Table[Column2] + Table[Column3], Table[Column4])

     

    regards

3 Replies

  • Hi Anonymous 

     

    Please use this. I've shared the output below.

    DIVIDE( SUMX( 'Table' , 'Table'[Column1] + 'Table'[Column2] + 'Table'[Column3] ) , 
            SUMX( 'Table' , 'Table'[Column4] ) )

     
    Thanks,
    Ankit Kukreja
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Ankit,

       

      Thanks for your response. I was able to derive accrurate figure based on the script mentioned below. Not sure why.

       

      Instead, i wrote below one and got the correct answer

       

      divide(Table[Column1] + Table[Column2] + Table[Column3], Table[Column4])

       

      regards