Forum Discussion
Calculate multiple columns
Hello Experts,
I am new to DAX queries. I am trying to calculate following fields, but unable to do so.
| Column A | Column B | Column C | Column D |
| 85 | 39 | 30 | 21 |
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
- Anonymous5 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
- AnkitKukreja
Super User
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- AnonymousNot 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
- AnkitKukreja
Super User
Yeah both would work. There are lot of scenarios where multiple solutions are possible.
I'm glad that you were able to solved it.Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904