Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
EugenioBeltran
Frequent Visitor

Round and divide DAX formula

Hello, i am looking for a DAX formula that combines divide and round, in example i ha tried round(divide(table1[cases],table1[cases per pallet],0) but it gives me an errors

 

Thank you for your help

3 ACCEPTED SOLUTIONS
andhiii079845
Super User
Super User

Do you use this as a measure? This will not work. You use columns without a minx,maxx or sumx...
Or do you use it as a calculated column? 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

andhiii079845
Super User
Super User

round(divide(table1[cases],table1[cases per pallet],0) a bracket is missing. 

round(divide(table1[cases],table1[cases per pallet]),0)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

v-zhangti
Community Support
Community Support

Hi, @EugenioBeltran 

 

You can try the following methods.
Sample data:

vzhangti_0-1678341270511.png

Measure = ROUND(DIVIDE(SELECTEDVALUE('Table'[Cases]),SELECTEDVALUE('Table'[Cases per pallet])),0)
Measure 2 = ROUND(DIVIDE(SUM('Table'[Cases]),SUM('Table'[Cases per pallet])),0)

vzhangti_1-1678341338199.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-zhangti
Community Support
Community Support

Hi, @EugenioBeltran 

 

You can try the following methods.
Sample data:

vzhangti_0-1678341270511.png

Measure = ROUND(DIVIDE(SELECTEDVALUE('Table'[Cases]),SELECTEDVALUE('Table'[Cases per pallet])),0)
Measure 2 = ROUND(DIVIDE(SUM('Table'[Cases]),SUM('Table'[Cases per pallet])),0)

vzhangti_1-1678341338199.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

andhiii079845
Super User
Super User

round(divide(table1[cases],table1[cases per pallet],0) a bracket is missing. 

round(divide(table1[cases],table1[cases per pallet]),0)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




EugenioBeltran
Frequent Visitor

It we works if I do =[cases]/[cases per pallet] but it does not work when I add round([cases]/[cases per pallet],0)

andhiii079845
Super User
Super User

Do you use this as a measure? This will not work. You use columns without a minx,maxx or sumx...
Or do you use it as a calculated column? 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I use it as a measure, , row by row 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors