Forum Discussion
Creating a measure that divides two colums
Hi!
I wish to create a measure that divides Column 1 by Column 2.
How do write a DAX for this as a measure?
Thanks!
Hi Anonymous ,
According to your question, you can try the following formula:
Measure = var a = SUM('Table'[Column1]) var b = SUM('Table'[Column2]) return DIVIDE(a,b,0)In addition, if you want to have a further understanding of the Divide function, you can refer to the official website document:DAX: DIVIDE function vs divide operator (/) - Power BI | Microsoft Docs
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- Tahreem24
Super User
Anonymous , Please share some sample data otherwise both v-henryk-mstf and amitchandak 's solutions will help you out.
- amitchandak
Super User
Anonymous ,
New measure = divide(sum(Table[Column 1]),sum(Table[Column 2])) // Sum can be count
or
New measure = Averagex(Table, Divide(Table[Column 1],Table[Column 2]))
- v-henryk-mstf
Community Support
Hi Anonymous ,
According to your question, you can try the following formula:
Measure = var a = SUM('Table'[Column1]) var b = SUM('Table'[Column2]) return DIVIDE(a,b,0)In addition, if you want to have a further understanding of the Divide function, you can refer to the official website document:DAX: DIVIDE function vs divide operator (/) - Power BI | Microsoft Docs
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.